Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (92 loc) · 2.23 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (92 loc) · 2.23 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
version: '3.8'
services:
postgres:
image: timescale/timescaledb:latest-pg16
container_name: tracer-postgres
environment:
POSTGRES_USER: tracer
POSTGRES_PASSWORD: tracer_dev_password
POSTGRES_DB: tracer
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U tracer']
interval: 10s
timeout: 5s
retries: 5
networks:
- tracer-network
api:
build:
context: .
dockerfile: apps/api/Dockerfile
container_name: tracer-api
environment:
DATABASE_URL: postgresql://tracer:tracer_dev_password@postgres:5432/tracer
API_PORT: 3000
NODE_ENV: production
LOG_LEVEL: info
RATE_LIMIT_WINDOW_MS: 900000
RATE_LIMIT_MAX: 100
CORS_ORIGIN: http://localhost:3001
ports:
- '3000:3000'
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
[
'CMD',
'node',
'-e',
"require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})",
]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
networks:
- tracer-network
restart: unless-stopped
processor:
build:
context: .
dockerfile: apps/processor/Dockerfile
container_name: tracer-processor
environment:
DATABASE_URL: postgresql://tracer:tracer_dev_password@postgres:5432/tracer
NODE_ENV: production
LOG_LEVEL: info
# Optional: Alert channels
# SLACK_WEBHOOK_URL: ${SLACK_WEBHOOK_URL}
# RESEND_API_KEY: ${RESEND_API_KEY}
# RESEND_FROM_EMAIL: ${RESEND_FROM_EMAIL}
depends_on:
postgres:
condition: service_healthy
networks:
- tracer-network
restart: unless-stopped
web:
build:
context: .
dockerfile: apps/web/Dockerfile
container_name: tracer-web
environment:
NEXT_PUBLIC_API_URL: http://api:3000
NODE_ENV: production
ports:
- '3001:3001'
depends_on:
- api
networks:
- tracer-network
restart: unless-stopped
volumes:
postgres_data:
networks:
tracer-network:
driver: bridge