2017-07-09 17:46:14 +02:00
|
|
|
version: '2'
|
|
|
|
|
|
|
|
services:
|
|
|
|
proxy:
|
2023-02-24 00:13:48 +01:00
|
|
|
image: traefik:v2.9
|
2017-07-09 17:46:14 +02:00
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
volumes:
|
2017-09-25 20:07:38 +02:00
|
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
2017-07-09 17:46:14 +02:00
|
|
|
- "./cert/:/cert/"
|
|
|
|
- "./config/:/etc/traefik/:ro"
|
2020-11-06 17:55:48 +01:00
|
|
|
- "./config/dynamic/:/etc/traefik/dynamic/:ro"
|
2017-07-09 17:46:14 +02:00
|
|
|
labels:
|
2019-12-01 01:16:21 +01:00
|
|
|
- "traefik.enable=true" # set to true to expose the Monitoring & API
|
|
|
|
# middleware redirect
|
|
|
|
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
|
|
|
# global redirect to https
|
|
|
|
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
|
|
|
|
- "traefik.http.routers.http-catchall.entrypoints=web"
|
|
|
|
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
|
|
|
|
|
2019-12-01 07:47:00 +01:00
|
|
|
- "traefik.docker.network=proxy_web"
|
2017-07-09 20:42:15 +02:00
|
|
|
networks:
|
|
|
|
- "web"
|
2017-07-09 17:46:14 +02:00
|
|
|
|
2019-12-01 08:21:43 +01:00
|
|
|
dumper:
|
|
|
|
image: ldez/traefik-certs-dumper:latest
|
|
|
|
volumes:
|
|
|
|
- "./cert/:/cert/"
|
|
|
|
- "/data/ssl/:/ssl/"
|
|
|
|
command: >
|
|
|
|
file --watch --source /cert/acme.json --version v2 --domain-subdir
|
|
|
|
--crt-name=fullchain --crt-ext=.pem
|
|
|
|
--key-name=privkey --key-ext=.pem
|
2022-11-25 22:00:12 +01:00
|
|
|
--clean=false
|
2020-05-27 00:28:20 +02:00
|
|
|
--post-hook "chmod -R a+r /ssl/"
|
2019-12-01 08:21:43 +01:00
|
|
|
--dest /ssl
|
|
|
|
|
2017-07-09 17:46:14 +02:00
|
|
|
networks:
|
2017-07-09 19:24:09 +02:00
|
|
|
web:
|
2017-07-09 17:46:14 +02:00
|
|
|
driver: bridge
|