Skip to content
docker-compose.yml 1.16 KiB
Newer Older
yalamerde's avatar
yalamerde committed
version: '2'
services:
  nginx:
    image: nginx
    container_name: nginx
    volumes:
      - /srv/docker-state/nginx/conf.d:/etc/nginx/conf.d
      - /srv/docker-state/nginx/vhost.d:/etc/nginx/vhost.d
      - /srv/docker-state/nginx/html:/usr/share/nginx/html
yalamerde's avatar
yalamerde committed
      - /srv/nginx/certs:/etc/nginx/certs:ro
      - /srv/nginx/proxy.conf:/etc/nginx/proxy.conf:ro
yalamerde's avatar
yalamerde committed
    ports:
      - "80:80"
      - "443:443"
    restart: always

  nginx-gen:
    image: jwilder/docker-gen
    container_name: nginx-gen
    command: "-notify-sighup nginx -watch -only-exposed -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf"
    volumes_from: [nginx]
    volumes:
      - /srv/nginx/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: always

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-letsencrypt
    depends_on: [nginx-gen]
    volumes_from: [nginx]
    volumes:
      - /srv/nginx/certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - NGINX_DOCKER_GEN_CONTAINER=nginx-gen
    restart: always