-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (73 loc) · 1.61 KB
/
docker-compose.yml
File metadata and controls
79 lines (73 loc) · 1.61 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
services:
db:
container_name: db
image: postgres:16.2-alpine
restart: always
ports:
- "5432:5432"
env_file:
- .env
- ./backend/.env.local
networks:
- app-network
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 2s
timeout: 5s
retries: 10
redis:
container_name: redis
image: redis:7.2-alpine
restart: always
ports:
- "6379:6379"
networks:
- app-network
volumes:
- redis-data:/redis/data
command: ["redis-server", "--save", "", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 5s
retries: 10
backend:
container_name: backend
build:
context: ./backend/
env_file:
- .env
- ./backend/.env.local
- ./backend/.env.production
ports:
- "3000:3000"
networks:
- app-network
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: ["sh", "-c", "npx prisma migrate deploy && npm run start:prod"]
proxy:
container_name: proxy
image: nginx:1.24-alpine-slim
volumes:
- type: bind
source: ./nginx.conf
target: /etc/nginx/nginx.conf
read_only: true
depends_on:
backend:
condition: service_started
ports:
- "80:80"
networks:
- app-network
networks:
app-network:
volumes:
db-data:
redis-data: