MA
web:
image: docker.test/vokamut/nginx:latest
restart: always
depends_on:
- app
links:
- app
volumes:
- ${PWD}/certs:/etc/nginx/ssl
ports:
- 80:80
- 443:443
networks:
- docker-net
env_file: .env.prod
Dockerfile:
FROM nginx:1.15-alpine
RUN apk --no-cache add gettext
COPY docker/vhost.conf /etc/nginx/nginx.conf.template
COPY public /var/www/public
ARG APP_DOMAIN
ENV APP_DOMAIN=$APP_DOMAIN
CMD ["/bin/sh", "-c", "/usr/bin/envsubst '$$APP_DOMAIN' < /etc/nginx/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"]
vhost.conf
server {
server_name ${APP_DOMAIN};
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/nginx/ssl/${APP_DOMAIN}.crt;
ssl_certificate_key /etc/nginx/ssl/${APP_DOMAIN}.key;
...