-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (65 loc) · 1.75 KB
/
docker-compose.yml
File metadata and controls
68 lines (65 loc) · 1.75 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
# docker-compose.yml — Development (hot-reload)
#
# Usage:
# docker compose up
#
# Frontend: http://localhost:3000
# Backend: http://localhost:4000
#
# For production:
# docker compose -f docker-compose.prod.yml up
version: "3.9"
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
ports:
- "4000:4000"
environment:
- PORT=4000
- NODE_ENV=development
- STELLAR_NETWORK=testnet
- HORIZON_URL=https://horizon-testnet.stellar.org
- ALLOWED_ORIGINS=http://localhost:3000
volumes:
# Mount source for hot-reload via nodemon
- ./backend:/app
# Preserve container's node_modules
- /app/node_modules
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_STELLAR_NETWORK=testnet
- NEXT_PUBLIC_HORIZON_URL=https://horizon-testnet.stellar.org
- NEXT_PUBLIC_API_URL=http://localhost:4000
# Enable polling so file-watch works on all host OSes (Linux/macOS/Windows)
- WATCHPACK_POLLING=true
- CHOKIDAR_USEPOLLING=true
volumes:
# Mount source for hot-reload via Next.js HMR
- ./frontend:/app
# Preserve container's node_modules and Next.js build cache
- /app/node_modules
- /app/.next
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped