Skip to content

Commit 554dda3

Browse files
committed
fix: use sh -c to allow ENV interpolation for runtime ports, add HOST runtime arg
1 parent f55a240 commit 554dda3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,19 @@ RUN chmod +x ${APP}/livecards
6161
USER $APP_USER
6262
WORKDIR ${APP}
6363

64-
# Use ARG for build-time configuration, ENV for runtime
64+
# Build-time arg for PORT, default to 8000
6565
ARG PORT=8000
66+
# Runtime environment var for PORT, default to build-time arg
6667
ENV PORT=${PORT}
6768
EXPOSE ${PORT}
6869

70+
# Build-time arg for HOST, default to 0.0.0.0 (ipv4 all interfaces)
71+
ARG HOST=0.0.0.0
72+
# Runtime environment var for HOST, default to build-time arg
73+
ENV HOST=${HOST}
74+
6975
# Add health check
7076
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
7177
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1
7278

73-
# Use ENTRYPOINT for the executable and CMD for default arguments
74-
ENTRYPOINT ["/usr/src/app/livecards"]
75-
CMD ["0.0.0.0:8000"]
79+
CMD ["sh", "-c", "exec ./livecards ${HOST}:${PORT}"]

0 commit comments

Comments
 (0)