-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathdocker-stack.yaml
72 lines (68 loc) · 1.94 KB
/
docker-stack.yaml
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
services:
traefik:
image: traefik:v3.1
command:
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=elliott@zenful.site"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
ports:
- mode: host
protocol: tcp
published: 80
target: 80
- mode: host
protocol: tcp
published: 443
target: 443
volumes:
- letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
web:
image: ghcr.io/dreamsofcode-io/zenstats:${GIT_COMMIT_HASH:-latest}
labels:
- "traefik.enable=true"
- "traefik.http.services.web.loadbalancer.server.port=8080"
- "traefik.http.routers.web.rule=Host(`zenful.site`)"
- "traefik.http.routers.web.entrypoints=websecure"
- "traefik.http.routers.web.tls.certresolver=myresolver"
secrets:
- db-password
environment:
- POSTGRES_HOST=db
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
- POSTGRES_USER=postgres
- POSTGRES_DB=app
- POSTGRES_PORT=5432
- POSTGRES_SSLMODE=disable
deploy:
update_config:
order: start-first
depends_on:
- db
db:
image: postgres
user: postgres
volumes:
- db-data:/var/lib/postgresql/data
secrets:
- db-password
environment:
- POSTGRES_DB=app
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data:
letsencrypt:
secrets:
db-password:
external: true