File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf.template
2424
2525# Create script to substitute environment variables in nginx config
2626RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \
27- echo 'envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && \
27+ echo '# Set PORT default if not provided' >> /docker-entrypoint.sh && \
28+ echo 'export PORT=${PORT:-4000}' >> /docker-entrypoint.sh && \
29+ echo 'envsubst "\$ PORT" < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf' >> /docker-entrypoint.sh && \
2830 echo 'exec nginx -g "daemon off;"' >> /docker-entrypoint.sh && \
2931 chmod +x /docker-entrypoint.sh
3032
Original file line number Diff line number Diff line change 11server {
2- listen ${ PORT:- 4000 } ;
2+ listen $PORT ;
33 server_name localhost;
44
55 location / {
You can’t perform that action at this time.
0 commit comments