-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
90 lines (86 loc) · 2.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
90 lines (86 loc) · 2.47 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
services:
postgres:
image: postgres:15-alpine
container_name: dataflow-postgres
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: dataflow
POSTGRES_PASSWORD: dataflow_password
POSTGRES_DB: dataflow_db
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dataflow -d dataflow_db && psql -U dataflow -d dataflow_db -c 'SELECT 1'"]
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
redis:
image: redis:7-alpine
container_name: dataflow-redis
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
adminer:
image: adminer:latest
container_name: dataflow-adminer
restart: unless-stopped
ports:
- "8080:8080"
environment:
ADMINER_DEFAULT_SERVER: postgres
depends_on:
- postgres
api:
build:
context: .
dockerfile: apps/api/Dockerfile.dev
container_name: dataflow-api
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DATABASE_URL=postgresql://dataflow:dataflow_password@postgres:5432/dataflow_db
- REDIS_URL=redis://redis:6379
- JWT_SECRET=development-secret-key
- PORT=3000
- CORS_ORIGIN=http://localhost:3001
volumes:
# Mount source code for hot reloading
- ./apps/api/src:/app/apps/api/src
- ./packages/types/src:/app/packages/types/src
- ./packages/shared/src:/app/packages/shared/src
# Mount config files that might change during development
- ./apps/api/nodemon.json:/app/apps/api/nodemon.json
- ./apps/api/tsconfig.json:/app/apps/api/tsconfig.json
# IMPORTANT: Preserve node_modules from the image
- /app/node_modules
- /app/apps/api/node_modules
- /app/packages/types/node_modules
- /app/packages/shared/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
redis_data: