-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (78 loc) · 2 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (78 loc) · 2 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
# Z-Image - Docker Compose Configuration
#
# Full-stack local development with Docker
#
# Usage:
# docker compose up # Start all services
# docker compose up api # Start API only
# docker compose up web # Start web only
# docker compose down # Stop all services
services:
# === API Service ===
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8787:8787"
environment:
- NODE_ENV=production
- PORT=8787
- CORS_ORIGINS=http://localhost:3000,http://localhost:5173
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8787/api/"]
interval: 30s
timeout: 3s
retries: 3
# === Web Service (for production preview) ===
web:
build:
context: .
dockerfile: Dockerfile.web
ports:
- "3000:80"
environment:
- VITE_API_URL=http://localhost:8787
depends_on:
api:
condition: service_healthy
restart: unless-stopped
# === Development Services ===
# Use these for local development with hot reload
api-dev:
image: node:20-alpine
working_dir: /app
volumes:
- .:/app
- /app/node_modules
- /app/apps/api/node_modules
- /app/apps/web/node_modules
- /app/packages/shared/node_modules
ports:
- "8787:8787"
environment:
- NODE_ENV=development
- PORT=8787
- CORS_ORIGINS=http://localhost:5173,http://localhost:3000
command: sh -c "corepack enable && pnpm install && pnpm dev:api"
profiles:
- dev
web-dev:
image: node:20-alpine
working_dir: /app
volumes:
- .:/app
- /app/node_modules
- /app/apps/api/node_modules
- /app/apps/web/node_modules
- /app/packages/shared/node_modules
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:8787
command: sh -c "corepack enable && pnpm install && pnpm dev:web"
depends_on:
- api-dev
profiles:
- dev