This repository was archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-stack.yml
executable file
·48 lines (43 loc) · 1.83 KB
/
docker-stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
version: "3.3"
services:
traefik:
image: "traefik:latest"
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker=true
- --providers.docker.swarmMode=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=web
- --providers.file.directory=/etc/certs/dynamic
- --api
- --log.level=ERROR
- --certificatesresolvers.lets-encrypt.acme.httpchallenge=true
- --certificatesresolvers.lets-encrypt.acme.email=email@yourdomain.local #Set your email address here, is for the generation of SSL certificates with Let's Encrypt.
# - --certificatesresolvers.lets-encrypt.acme.storage=./acme.json
- --certificatesresolvers.lets-encrypt.acme.httpchallenge.entrypoint=web
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- traefik-data:/etc/certs #Volume where SSL certs are saved
# - "./acme.json:/acme.json"
labels:
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# Dashboard
- "traefik.http.routers.traefik.rule=Host(`traefik.yourdomain.local`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=admin"
- "traefik.http.routers.traefik.tls.certresolver=lets-encrypt"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.middlewares.admin.basicauth.users=admin:$$2y$$05$$IbYykP9bwz8PAhYBxvDkAOdEwMkMvdUvE86OO8EcEAp16Otddn4a6"
networks:
default:
external:
name: web
volumes:
traefik-data: