-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (60 loc) · 1.34 KB
/
docker-compose.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
version: '3.8'
networks:
caddy:
driver: overlay
attachable: true
volumes:
postgres_data: {}
caddy_data: {}
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:2.7.1
ports:
- 80:80
- 443:443
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# this volume is needed to keep the certificates
# otherwise, new ones will be re-issued upon restart
- caddy_data:/data
environment:
# This must match the network name generated by docker stack or docker compose
- CADDY_INGRESS_NETWORKS=hello_app_caddy
deploy:
# labels: # Global options
# caddy.email: [email protected]
placement:
constraints:
- node.role == manager
replicas: 1
restart_policy:
condition: on-failure
db:
image: postgres:14.5
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- "postgres_data:/var/lib/postgresql/data"
env_file:
- config/docker.env
networks:
- caddy
web:
image: hello_app:0.3.0
deploy:
replicas: 1
restart_policy:
condition: on-failure
depends_on:
- db
env_file:
- config/docker.env
networks:
- caddy
labels:
caddy: localhost
caddy.reverse_proxy: "{{upstreams 4000}}"