I have this docker-compose already working in my homeLab for quite a while and now I'm trying to migrate most of my docker containers to Synology.
Adding a macvlan network to my previous compose file just can't make it working, I'm getting to the conclusion that it's impossible to use Traefik on Synology with macvlan.
version: '3.5'
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
macvlan:
ipv4_address: 192.168.xx.xx
proxy:
ports:
- 80:80
- 443:443
environment:
- PIHOLE_UID=111
- PIHOLE_GID=111
- TZ=Europe/Warsaw
- CF_API_EMAIL=xxx.com
- CF_API_KEY=xxx
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /volume1/docker/traefik/data/traefik.yml:/traefik.yml:ro
- /volume1/docker/traefik/data/acme.json:/acme.json
- /volume1/docker/traefik/data/config.yml:/config.yml:ro
- /volume1/docker/traefik/logs:/var/log/traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`proxy.local.domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.middlewares.traefik-auth.basicauth.users=xxx:xxx"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`proxy.local.domain.com`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=local.domain.com"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.local.domain.com"
- "traefik.http.routers.traefik-secure.service=api@internal"
- "traefik.http.routers.traefik.service=api@internal"
networks:
macvlan:
external: true
proxy:
external: true