diff options
Diffstat (limited to 'sw-server')
-rw-r--r-- | sw-server/Dockerfile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw-server/Dockerfile b/sw-server/Dockerfile index 7c372052..740c2514 100644 --- a/sw-server/Dockerfile +++ b/sw-server/Dockerfile @@ -2,7 +2,11 @@ FROM openjdk:11-jre EXPOSE 80 +# Heroku uses the PORT environment variable, it ignores EXPOSE. +# This also allows to specify a custom port when running the container even outside of Heroku. +ENV PORT 80 + ARG JAR_FILE=build/libs/sw-server.jar COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java", "-Dserver.port=80", "-jar", "/app.jar"] +ENTRYPOINT ["java", "-Dserver.port=$PORT", "-jar", "/app.jar"] |