-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (115 loc) · 3.55 KB
/
docker-compose.yml
File metadata and controls
120 lines (115 loc) · 3.55 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
services:
# ============================================================================
# POSTGRES DATABASE
# ============================================================================
postgres:
image: postgres:17-alpine
container_name: corely_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-corely}
POSTGRES_USER: ${POSTGRES_USER:-corely}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-corely}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-corely}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- corely
# ============================================================================
# REDIS CACHE & QUEUE
# ============================================================================
redis:
image: redis:7-alpine
container_name: corely_redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
networks:
- corely
# ============================================================================
# NESTJS API (DEMO & FULL PROFILES)
# ============================================================================
api:
build:
context: .
dockerfile: Dockerfile.api
container_name: corely_api
restart: unless-stopped
profiles:
- full
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: ${NODE_ENV:-development}
DATABASE_URL: ${DATABASE_URL:-postgresql://corely:corely@postgres:5432/corely?schema=public}
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
LOG_LEVEL: debug
ports:
- "${PORT:-3000}:3000"
volumes:
- ./services/api/src:/app/services/api/src
- ./packages/data/src:/app/packages/data/src
- ./packages/contracts/src:/app/packages/contracts/src
- ./packages/domain/src:/app/packages/domain/src
networks:
- corely
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
# ============================================================================
# VITE FRONTEND (DEMO & FULL PROFILES)
# ============================================================================
web:
build:
context: .
dockerfile: Dockerfile.web
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:4000}
container_name: corely_web
restart: unless-stopped
ports:
- "${WEB_PORT:-8080}:8080"
environment:
NODE_ENV: ${NODE_ENV:-development}
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:4000}
volumes:
- ./apps/web/src:/app/apps/web/src
- ./apps/web/index.html:/app/apps/web/index.html
- ./apps/web/vite.config.ts:/app/apps/web/vite.config.ts
- ./packages/contracts/src:/app/packages/contracts/src
networks:
- corely
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
volumes:
postgres_data:
redis_data:
networks:
corely:
driver: bridge