ARG IMAGENAME FROM ${IMAGENAME} ENV DOMAIN_NAME=default COPY ./ssl.conf.template /etc/nginx/conf.d/ssl.conf.template VOLUME ["/etc/nginx/conf.d/cert/"] EXPOSE 80 443 CMD /bin/sh -c "envsubst '\$DOMAIN_NAME' < /etc/nginx/conf.d/ssl.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"