2021-12-13 20:29:29 +01:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
services:
|
|
|
|
traefik:
|
2022-06-21 20:06:38 +02:00
|
|
|
image: traefik:v2.7.1
|
2021-12-13 20:29:29 +01:00
|
|
|
container_name: traefik
|
|
|
|
restart: unless-stopped
|
|
|
|
security_opt:
|
|
|
|
- no-new-privileges:true
|
|
|
|
networks:
|
|
|
|
- proxy
|
|
|
|
ports:
|
|
|
|
- 80:80
|
|
|
|
- 443:443
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
- ./traefik.yml:/traefik.yml:ro
|
|
|
|
- ./users.txt:/users.txt:ro
|
|
|
|
- ./acme.json:/acme.json
|
|
|
|
labels:
|
|
|
|
- traefik.enable=true
|
|
|
|
- traefik.http.middlewares.basicauth.basicauth.usersfile=/users.txt
|
|
|
|
- traefik.http.routers.traefik-secure.entrypoints=websecure
|
|
|
|
- traefik.http.routers.traefik-secure.rule=Host(`${HOSTNAME}`)
|
|
|
|
- traefik.http.routers.traefik-secure.middlewares=basicauth
|
|
|
|
- traefik.http.routers.traefik-secure.tls=true
|
|
|
|
- traefik.http.routers.traefik-secure.tls.certresolver=letsencrypt
|
|
|
|
- traefik.http.routers.traefik-secure.service=api@internal
|
|
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
external: true
|