version: '3'

services:

  nginx-proxy:
    image: nginxproxy/nginx-proxy:1.6.1
    container_name: nginx-proxy
    restart: unless-stopped
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /srv/www/nginx-proxy/proxy.conf:/etc/nginx/proxy.conf
      - /srv/www/nginx-proxy/cd.conf:/etc/nginx/conf.d/cd.conf
      - certs:/etc/nginx/certs
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro

  nginx-proxy-acme:
    image: nginxproxy/acme-companion:2.4.0
    container_name: nginx-proxy-acme
    restart: unless-stopped
    volumes_from:
      - nginx-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - acme:/etc/acme.sh
    environment:
      NGINX_PROXY_CONTAINER: "nginx-proxy"
      DEFAULT_EMAIL: "{{LETSENCRYPT_EMAIL}}"

networks:

  default:
    external:
      name: nginx-proxy
volumes:
  conf:
  vhost:
  html:
  certs:
  acme:
