-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-swarm-traefik.yml
86 lines (80 loc) · 2.2 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
version: "3.8"
# https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
caddy:
image: caddy:latest
# https://hub.docker.com/_/caddy
volumes:
- phorge_web:/var/www/html
- caddy_data:/data
networks:
- phorge
- traefik
configs:
- source: phorge_caddyfile
target: /etc/caddy/Caddyfile
environment:
# https://caddyserver.com/docs/automatic-https#overview
- DOMAIN=:80
deploy:
labels:
# Essential traefik labels https://doc.traefik.io/traefik/providers/docker/
- "traefik.enable=true"
- "traefik.http.routers.phorge.entrypoints=websecure"
- "traefik.http.routers.phorge.rule=Host(`phorge.yourdomain.test`)"
- "traefik.http.services.phorge.loadbalancer.server.port=80" # Port traefik needs to route traffic to
mariadb:
image: mariadb:latest
# https://hub.docker.com/_/mariadb
volumes:
- phorge_db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/phorge_db_password
command: --innodb-buffer-pool-size=268435456 --local-infile=0 --max-allowed-packet=33554432 --sql-mode=STRICT_ALL_TABLES
secrets:
- phorge_db_password
networks:
- phorge_db
phorge:
image: zeigren/phorge:latest # ghcr.io/zeigren/phorge_docker:latest
# https://hub.docker.com/r/zeigren/phorge
volumes:
- phorge_web:/var/www/html
- phorge_ssh:/etc/ssh
- phorge_repo:/var/repo
environment:
# set UPGRADE_ON_RESTART to true to update phorge
- UPGRADE_ON_RESTART=true
- PH_BASE_URI=https://phorge.yourdomain.test
- PH_MYSQL_PASS=DOCKER-SECRET->phorge_db_password
# - PH_CLUSTER_MAILERS=true
networks:
- phorge
- phorge_db
ports:
# SSH Port
- 2530:2530
# configs:
# - source: phorge_mailers.json
# target: /usr/src/docker_ph/mailers.json
secrets:
- phorge_db_password
volumes:
phorge_web:
phorge_db:
phorge_ssh:
phorge_repo:
caddy_data:
networks:
phorge:
phorge_db:
traefik:
external: true
secrets:
phorge_db_password:
external: true
configs:
phorge_caddyfile:
external: true
# phorge_mailers.json:
# external: true