-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (72 loc) · 1.86 KB
/
docker-compose.yml
File metadata and controls
76 lines (72 loc) · 1.86 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
version: "3.8"
services:
# 1. Database (PostgreSQL)
db:
image: postgres:15-alpine
container_name: metaverse-db
restart: always
environment:
POSTGRES_DB: metaverse_db
POSTGRES_USER: team_admin
POSTGRES_PASSWORD: ${DB_PASSWORD} # .env 또는 GitHub Secrets에서 주입
ports:
- "5432:5432"
volumes:
- ./postgres_data:/var/lib/postgresql/data # 데이터 영구 보존
healthcheck:
test: ["CMD-SHELL", "pg_isready -U team_admin -d metaverse_db"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- metaverse-network
# 2. FastAPI Backend
fastapi:
build:
context: ./fastapi-backend
dockerfile: Dockerfile
container_name: fastapi-app
restart: always
environment:
- DATABASE_URL=postgresql://team_admin:${DB_PASSWORD}@db:5432/metaverse_db
- JWT_SECRET=${JWT_SECRET}
- SECRET_KEY=${SECRET_KEY}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- BACKEND_URL=${BACKEND_URL}
- FRONTEND_URL=${FRONTEND_URL}
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/ || exit 1"]
interval: 5s
timeout: 5s
retries: 10
start_period: 15s
networks:
- metaverse-network
# 3. Colyseus Real-time Server
colyseus:
build:
context: ./colyseus-server
dockerfile: Dockerfile
container_name: colyseus-server
restart: always
environment:
- API_URL=http://fastapi:8000
- JWT_SECRET=${JWT_SECRET}
- NODE_ENV=${NODE_ENV}
ports:
- "2567:2567"
depends_on:
fastapi:
condition: service_healthy
networks:
- metaverse-network
networks:
metaverse-network:
driver: bridge