summaryrefslogtreecommitdiff
path: root/sw-server/Dockerfile
blob: 84a062a56f54b7c969c35ffcb9a407cb0dd08c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
FROM openjdk:17

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

# We need sh to perform the substitution of $PORT
# We cannot use ENTRYPOINT because Heroku escapes the $ in ENTRYPOINT, so CMD it is
CMD ["sh", "-c", "java -Dserver.port=$PORT -jar /app.jar"]
bgstack15