version: "3.5"
services:
  nginx-proxy:
    container_name: nginx-proxy
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    image: jwilder/nginx-proxy:latest
    volumes:
      - ./custom_settings.conf:/etc/nginx/conf.d/custom_settings.conf      
      - nginx-certs:/etc/nginx/certs
      - nginx-vhost:/etc/nginx/vhost.d
      - nginx-html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
    environment:
      - DEFAULT_HOST="*.home.toozhao.com"
  proxy-letsencrypt:
    depends_on:
      - nginx-proxy
    restart: unless-stopped
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes:
      - nginx-certs:/etc/nginx/certs
      - nginx-vhost:/etc/nginx/vhost.d
      - nginx-html:/usr/share/nginx/html
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - DEFAULT_EMAIL="me@toozhao.com"
      - NGINX_PROXY_CONTAINER=nginx-proxy
  ddns:
    restart: unless-stopped
    image: peteward44/godaddy-ddns
    environment:
      - GODADDY_KEY=9ZpTeFUt9G3_MxGrYikGF6n77nAjB9tQow
      - GODADDY_SECRET=MxHfis9ADQgwqtdRTJ5KPb
      - GODADDY_DOMAIN=toozhao.com
      - GODADDY_TYPE=A
      - GODADDY_NAME="*.home"

volumes:
  nginx-certs:
  nginx-html:
  nginx-vhost:
