02 Info
Damit Docker-Container von Traefik erkannt werden, müssen diese im gleichen Netz betrieben werden wie Traefik!
Der Container muss mit einem YAML-File, in dem Labels und das Network definiert sind, aufgesetzt werden
Beispiel YAML Docker Compose für Photoshow:
version: "2.1"
services:
photoshow:
image: lscr.io/linuxserver/photoshow:latest
container_name: photoshow
environment:
- PUID=1001
- PGID=1001
- TZ=Europe/Zurich
volumes:
- /home/admin_ps/photoshow/Config:/config
- /home/admin_ps/photoshow/Photos:/Pictures:ro
- /home/admin_ps/photoshow//Thumbs:/Thumbs
ports:
- 2342:2342
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.photoshow.entrypoints=http"
- "traefik.http.routers.photoshow.rule=Host(`photoshow.loecker.ch`)"
- "traefik.http.middlewares.photoshow-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.photoshow.middlewares=photoshow-https-redirect"
- "traefik.http.routers.photoshow-secure.entrypoints=https"
- "traefik.http.routers.photoshow-secure.rule=Host(`photoshow.loecker.ch`)"
- "traefik.http.routers.photoshow-secure.tls=true"
- "traefik.http.routers.photoshow-secure.tls.certresolver=http"
- "traefik.http.routers.photoshow-secure.service=photoshow"
- "traefik.http.services.photoshow.loadbalancer.server.port=2342"
- "traefik.docker.network=proxy"
networks:
- proxy
networks:
proxy:
external: true