lucaslorentz / caddy-docker-proxy

Caddy as a reverse proxy for Docker
MIT License
2.85k stars 169 forks source link

Global options seems not working in caddy-docker-proxy itself #632

Closed fky2015 closed 3 months ago

fky2015 commented 3 months ago

As the docs said:

Global options can be defined by not setting any value for caddy. They can be set in any container/service, including caddy-docker-proxy itself. Here is an example

A minimum reproducible example is here:

version: "3.7"
services:
  caddy:
    image: lucaslorentz/caddy-docker-proxy:ci-alpine
    # build: ./
    ports:
      - 80:80
      - 443:443
    environment:
      - CADDY_INGRESS_NETWORKS=caddy
    networks:
      - caddy
    labels:
      caddy.email: you@example.com
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - caddy_data:/data
      - ./config:/config/caddy
    restart: unless-stopped

networks:
  caddy:
    external: true

volumes:
  caddy_data: {}

Then run:

docker compose up -d
cat config/Caddyfile.autosave

Got:

# Empty caddyfile
fky2015 commented 3 months ago

In fact, this problem does not exist