Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
130 lines (124 loc) · 2.46 KB
/
Copy pathdocker-compose.yml
File metadata and controls
130 lines (124 loc) · 2.46 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
networks:
app:
volumes:
pgsql-data:
redis-data:
services:
client:
build:
context: ./client
dockerfile: Dockerfile
env_file:
- ./client/.env
ports:
- 3000:3000
volumes:
- ./client:/app
- /app/node_modules
networks:
- app
deploy:
resources:
limits:
cpus: "0.50"
memory: 512m
reservations:
memory: 256m
api:
build:
context: ./server
dockerfile: Dockerfile
env_file:
- ./server/.env
ports:
- 3001:3001
volumes:
- ./server:/app
- /app/.venv
networks:
- app
depends_on:
- pgsql
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/healthz"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
deploy:
resources:
limits:
cpus: "0.25"
memory: 256m
reservations:
memory: 128m
pgsql:
image: postgres:18-trixie
ports:
- ${DB_PORT:-5432}:5432
environment:
POSTGRES_DB: ${DB_DATABASE:-postgres}
POSTGRES_USER: ${DB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
volumes:
- pgsql-data:/var/lib/postgresql
networks:
- app
restart: unless-stopped
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USERNAME:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.25"
memory: 256m
reservations:
memory: 128m
redis:
image: redis:8.6.0-alpine3.23
ports:
- "${REDIS_PORT:-6379}:6379"
environment:
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
volumes:
- redis-data:/data
networks:
- app
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.25"
memory: 256m
reservations:
memory: 128m
# nginx:
# build:
# context: ./nginx
# dockerfile: Dockerfile
# ports:
# - "80:80"
# - "443:443"
# depends_on:
# - client
# - api
# networks:
# - app
# restart: unless-stopped
# deploy:
# resources:
# limits:
# cpus: "0.25"
# memory: 128m
# reservations:
# memory: 64m