multiple configs depending on wether or not we have cert

This commit is contained in:
2025-11-20 21:46:20 +00:00
parent 8c2b99d65f
commit d8aa357414
6 changed files with 78 additions and 24 deletions

View File

@@ -3,11 +3,17 @@ FROM nginx:latest
# Copy template config
COPY nginx.conf.template /etc/nginx/nginx.conf.template
COPY nginx_setup.conf.template /etc/nginx/nginx_setup.conf.template
COPY entrypoint.sh /entrypoint.sh
# Update package list and install gettext-base
RUN apt-get update && apt-get install -y gettext-base
# Replace variables at build time
ENV BACKEND_HOST=backend
ENV DOMAIN=example.com
ENV CERT_PATH=/etc/letsencrypt/live/$DOMAIN
CMD /bin/sh -c "envsubst '\$BACKEND_HOST' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
ENTRYPOINT ["/entrypoint.sh"]