version: "3.9" services: caddy: image: caddy:2.7.6-alpine container_name: caddy hostname: caddy restart: always networks: - site_network - app_network ports: - "443:443" volumes: - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro - ./hosts:/etc/hosts:ro - ./Caddyfile:/etc/caddy/Caddyfile - ./conf/:/config/ - ./site/:/var/www/ - ./data/:/data/ - ./logs/:/var/log/caddy - ./cert/:/var/cert/ networks: site_network: name: site_network external: true # driver: bridge # driver_opts: # encrypted: 'true' # ipam: # driver: default # config: # - subnet: 172.21.0.1/24 app_network: name: app_network external: true # driver: bridge # driver_opts: # encrypted: 'true' # ipam: # driver: default # config: # - subnet: 172.21.0.1/24