multiple configs depending on wether or not we have cert
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user