-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (82 loc) · 2.1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
86 lines (82 loc) · 2.1 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
services:
postgres:
image: postgres:16-alpine
container_name: fastsaas-postgres
environment:
POSTGRES_DB: fastsaas
POSTGRES_USER: fastsaas
POSTGRES_PASSWORD: fastsaas
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:7-alpine
container_name: fastsaas-redis
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
api:
build:
context: .
dockerfile: packages/api/Dockerfile
target: runtime
container_name: fastsaas-api
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
APP_NAME: api
PORT: 3000
DATABASE_URL: postgresql://fastsaas:fastsaas@postgres:5432/fastsaas?sslmode=disable
REDIS_URL: redis://redis:6379
HEALTH_PATH: /health
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
portal:
build:
context: .
dockerfile: packages/portal/Dockerfile
target: runtime
container_name: fastsaas-portal
depends_on:
api:
condition: service_healthy
environment:
APP_NAME: portal
PORT: 3001
API_BASE_URL: http://api:3000
HEALTH_PATH: /health
ports:
- "3001:3001"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3001/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
volumes:
postgres-data:
redis-data: