-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-deploy.yml
101 lines (91 loc) · 1.78 KB
/
docker-deploy.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
90
91
92
93
94
95
96
97
98
99
100
101
version: '3.7'
configs:
redis_config:
file: ./docker_config/redis.conf
services:
app:
image: 127.0.0.1:5000/fastapi-app
build:
context: ./
dockerfile: Dockerfile
command: uvicorn app.main:app --host 0.0.0.0 --reload --workers 1
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
placement:
constraints:
- node.role == manager # Deploy containers to worker nodes
ports:
- 80:8000
env_file:
- .env
networks:
- backend
db:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
deploy:
mode: global
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
ports:
- 5432:5432
env_file:
- .env
networks:
- backend
pgadmin:
image: dpage/pgadmin4
ports:
- 5050:5050
env_file:
- .env
networks:
- backend
redis:
image: redis:alpine
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
ports:
- 6379:6379
networks:
- backend
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [ node.role == manager ]
networks:
- backend
networks:
backend:
name: backend
volumes:
postgres_data:
# driver: "rexray/rbd"
# driver_opts:
# size: "50"
sms_data:
# driver: "rexray/rbd"
# driver_opts:
# size: "50"