-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
115 lines (108 loc) · 2.1 KB
/
docker-compose.yaml
File metadata and controls
115 lines (108 loc) · 2.1 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
services:
db:
image: postgres:latest
container_name: chat_db
restart: always
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d chat_db"]
interval: 15s
timeout: 10s
retries: 15
deploy:
resources:
limits:
cpus: "0.40"
memory: 1G
networks:
- chat_network
db_migrator:
build: ./db
container_name: chat_db_migrator
init: true
env_file:
- ./db/.env
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.70"
memory: 512M
networks:
- chat_network
server_rest:
build: ./server
container_name: chat_api
init: true
restart: always
depends_on:
db_migrator:
condition: service_completed_successfully
deploy:
resources:
limits:
cpus: "0.30"
memory: 512M
networks:
- chat_network
websocket:
build: ./websocket
init: true
restart: always
env_file:
- ./websocket/.env
depends_on:
redis:
condition: service_started
db_migrator:
condition: service_completed_successfully
deploy:
replicas: 2
resources:
limits:
cpus: "0.20"
memory: 400M
networks:
- chat_network
redis:
image: redis:alpine
container_name: chat_redis
restart: always
deploy:
resources:
limits:
cpus: "0.15"
memory: 384M
networks:
- chat_network
nginx:
build: ./.nginx
container_name: chat_nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on:
websocket:
condition: service_started
server_rest:
condition: service_started
deploy:
resources:
limits:
cpus: "0.10"
memory: 128M
networks:
- chat_network
volumes:
postgres_data:
networks:
chat_network:
driver: bridge