services:
  caddy:
    container_name: caddy
    image: iarekylew00t/caddy-cloudflare:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    extra_hosts:
      - 'host.docker.internal:host-gateway'
    networks:
      - bizmatch
      - keycloak
      - gitea
      - mail_network
    volumes:
      - $PWD/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
      - /home/aknuth/git/bizmatch-project/bizmatch/dist/bizmatch/browser:/srv
      - /home/aknuth/git/bizmatch-project/bizmatch-server/pictures:/home/aknuth/git/bizmatch-project/bizmatch-server/pictures
      - /home/aknuth/git/bay-area-affiliates/dist/bay-area-affiliates/browser:/app
      - /home/aknuth/log/caddy:/var/log/caddy
    environment:
      - CLOUDFLARE_API_TOKEN=q1P7J3uqS96FGj_iiX2mI8y1ulTaIFrTp8tyTXhG
      - CLOUDFLARE_EMAIL=andreas.knuth@gmail.com

networks:
  bizmatch:
    external: true
  keycloak:
    external: true
  gitea:
    external: true
  mail_network:
    external: true

volumes:
  caddy_data:
    external: true
  caddy_config:
