dotfiles/docker/træfik/docker-compose.yaml

54 lines
1.7 KiB
YAML
Raw Normal View History

2020-02-13 21:24:50 +02:00
version: '3'
services:
traefik:
2020-12-06 11:36:01 +02:00
image: traefik:latest
2020-02-13 21:24:50 +02:00
container_name: traefik
restart: unless-stopped
ports:
- '80:80'
- '443:443'
environment:
- TZ=Europe/Helsinki
security_opt:
- no-new-privileges:true
networks:
- proxy
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
2021-04-19 20:19:14 +03:00
- /docker/træfik/træfik/traefik.yml:/traefik.yml:ro
- /docker/træfik/træfik/dashboard-users:/dashboard-users:ro
- /docker/træfik/træfik/acme.json:/acme.json
- /docker/træfik/træfik/log:/var/log
2020-02-13 21:24:50 +02:00
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.redirect.entrypoints=http'
2020-12-06 11:36:01 +02:00
- 'traefik.http.routers.redirect.rule=Host(`traefik.korhonen.cc`)'
2020-02-13 21:24:50 +02:00
- 'traefik.http.middlewares.http2https.redirectscheme.scheme=https'
- 'traefik.http.routers.redirect.middlewares=http2https'
- 'traefik.http.routers.dashboard.entrypoints=https'
2020-12-06 11:36:01 +02:00
- 'traefik.http.routers.dashboard.rule=Host(`traefik.korhonen.cc`)'
2020-02-13 21:24:50 +02:00
- 'traefik.http.middlewares.dashboard-auth.basicauth.usersfile=/dashboard-users'
- 'traefik.http.routers.dashboard.middlewares=dashboard-auth'
- 'traefik.http.routers.dashboard.tls=true'
- 'traefik.http.routers.dashboard.tls.certresolver=http'
- 'traefik.http.routers.dashboard.service=api@internal'
2021-04-19 20:19:14 +03:00
fail2ban:
image: crazymax/fail2ban:latest
container_name: fail2ban
restart: unless-stopped
network_mode: "host"
cap_add:
- NET_ADMIN
- NET_RAW
volumes:
- /docker/træfik/træfik/log:/var/log/træfik:ro
- /docker/træfik/fail2ban:/data
2020-02-13 21:24:50 +02:00
networks:
proxy:
external: true