-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-swarm-traefik.yml
89 lines (82 loc) · 2.27 KB
/
docker-swarm-traefik.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: "3.8"
# https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
caddy:
image: caddy:latest
# https://hub.docker.com/_/caddy
volumes:
- bookstack_public:/var/www/bookstack/public
- caddy_data:/data
networks:
- bookstack
- traefik
configs:
- source: bookstack_caddyfile
target: /etc/caddy/Caddyfile
environment:
# https://caddyserver.com/docs/automatic-https#overview
- DOMAIN=:80
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.bookstack.entrypoints=websecure"
- "traefik.http.routers.bookstack.rule=Host(`bookstack.yourdomain.test`)"
- "traefik.http.services.bookstack.loadbalancer.server.port=80" # Port traefik needs to route traffic to
mariadb:
image: mariadb:latest
# https://hub.docker.com/_/mariadb
volumes:
- bookstack_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/bookstacksql_password
- MYSQL_DATABASE=bookstack
- MYSQL_USER=bookstack
- MYSQL_PASSWORD_FILE=/run/secrets/bookstacksql_password
secrets:
- bookstacksql_password
networks:
- bookstack_db
bookstack:
image: zeigren/bookstack:latest # ghcr.io/zeigren/bookstack_docker:latest
# https://hub.docker.com/r/zeigren/bookstack
environment:
- DB_PASSWORD=DOCKER-SECRET->bookstacksql_password
- APP_URL=https://bookstack.yourdomain.test
# Can be 'local', 'local_secure' or 's3'
- STORAGE_TYPE=local
# Run first without APP_KEY to have the container create one
# - APP_KEY=DOCKER-SECRET->bookstack_app_key
volumes:
- bookstack_storage:/var/www/bookstack/storage
- bookstack_public:/var/www/bookstack/public
networks:
- bookstack
- bookstack_db
- redis
secrets:
- bookstacksql_password
- bookstack_app_key
redis:
image: redis:alpine
# https://hub.docker.com/_/redis
networks:
- redis
volumes:
bookstack_db:
bookstack_storage:
bookstack_public:
caddy_data:
secrets:
bookstacksql_password:
external: true
bookstack_app_key:
external: true
networks:
bookstack:
bookstack_db:
redis:
traefik:
external: true
configs:
bookstack_caddyfile:
external: true