From 0967c8d72c2b373baf3600930c48eb020699f7e2 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 12 Dec 2020 21:30:29 +0100 Subject: Push Docker image to Heroku, remove Travis CI --- sw-server/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sw-server') 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"] -- cgit