-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (117 loc) · 2.57 KB
/
docker-compose.yml
File metadata and controls
124 lines (117 loc) · 2.57 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
version: '3.8'
networks:
backend-net:
driver: bridge
frontend-net:
driver: bridge
volumes:
postgres_data:
redis_data:
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-development_password}
POSTGRES_DB: ${DB_NAME:-megaticketing}
volumes:
- postgres_data:/var/lib/postgresql/data
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- backend-net
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data:/data
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- backend-net
api:
build:
context: .
dockerfile: apps/api/Dockerfile
restart: unless-stopped
deploy:
replicas: 3
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
environment:
- NODE_ENV=${NODE_ENV:-production}
- PORT=3001
- REDIS_HOST=redis
- REDIS_PORT=6379
- DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-development_password}@db:5432/${DB_NAME:-megaticketing}?schema=public
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-sk_test_placeholder}
- JWT_SECRET=${JWT_SECRET:-placeholder_at_least_32_chars}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- backend-net
web:
build:
context: .
dockerfile: apps/web/Dockerfile
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 128M
networks:
- frontend-net
gateway:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "3001:80"
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
depends_on:
- api
- web
networks:
- frontend-net
- backend-net