-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
197 lines (189 loc) · 3.91 KB
/
Copy pathdocker-compose.yml
File metadata and controls
197 lines (189 loc) · 3.91 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
services:
postgres:
image: postgres:18-alpine
container_name: ${DATABASE_HOST:-postgres}
ports:
- "${DATABASE_PORT:-5432}:${DATABASE_PORT:-5432}"
environment:
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
PGPORT: ${DATABASE_PORT:-5432}
command:
- -p
- "${DATABASE_PORT:-5432}"
- -c
- shared_buffers=256MB
- -c
- effective_cache_size=768MB
- -c
- maintenance_work_mem=128MB
- -c
- max_connections=100
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app_network
- web
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.75"
memory: 1G
reservations:
cpus: "0.1"
memory: 256M
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME} -p ${DATABASE_PORT:-5432}",
]
interval: 10s
timeout: 5s
retries: 5
postgresus:
container_name: postgresus
image: rostislavdugin/postgresus:latest
ports:
- "4005:4005"
networks:
- app_network
- web
volumes:
- postgresus_data:/postgresus-data
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.15"
memory: 128M
reservations:
cpus: "0.05"
memory: 64M
portainer:
container_name: portainer
image: portainer/portainer-ce:latest
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
ports:
- 9443:9443
- 8020:8000
networks:
- app_network
- web
valkey:
image: valkey/valkey:latest
container_name: ${REDIS_HOST:-valkey}
ports:
- "${REDIS_PORT:-6379}:${REDIS_PORT:-6379}"
volumes:
- valkey_data:/data
networks:
- app_network
- web
restart: unless-stopped
command:
- valkey-server
- --port
- "${REDIS_PORT:-6379}"
- --requirepass
- "${REDIS_PASSWORD}"
- --maxmemory
- 384mb
- --maxmemory-policy
- allkeys-lru
- --save
- ""
deploy:
resources:
limits:
cpus: "0.3"
memory: 512M
reservations:
cpus: "0.05"
memory: 128M
healthcheck:
test:
[
"CMD",
"valkey-cli",
"-p",
"${REDIS_PORT:-6379}",
"-a",
"${REDIS_PASSWORD}",
"ping",
]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./apps/api
dockerfile: Dockerfile
container_name: backend
ports:
- "8040:8000"
environment:
REDIS_HOST: valkey
depends_on:
postgres:
condition: service_healthy
valkey:
condition: service_healthy
env_file:
- .env
networks:
- app_network
- web
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.6"
memory: 768M
reservations:
cpus: "0.1"
memory: 256M
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8000/api/utils/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
frontend:
build:
context: ./apps/web
dockerfile: Dockerfile
args:
- APP_BACKEND=${APP_BACKEND}
container_name: frontend
ports:
- "8041:8080"
env_file:
- .env
networks:
- app_network
- web
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.5"
memory: 1G
reservations:
cpus: "0.1"
memory: 256M
volumes:
postgres_data:
valkey_data:
portainer_data:
postgresus_data:
networks:
app_network:
driver: bridge
web:
external: true