-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcompose.local.yml
119 lines (112 loc) · 3.22 KB
/
compose.local.yml
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
version: "3.8"
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
redis:
image: redis:latest
environment:
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
networks:
- net
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
retries: 3
start_period: 10s
timeout: 5s
backend:
build:
context: .
dockerfile: ./services/backend/Dockerfile.local
image: backend:latest
env_file:
- .env
volumes:
- .env:/app/.env
# 소스 코드 마운트
- ./apps/backend:/app/apps/backend
- ./apps/frontend:/app/apps/frontend
# 의존성 캐시를 위한 볼륨
- backend_node_modules:/app/node_modules
- backend_app_node_modules:/app/apps/backend/node_modules
- frontend_app_node_modules:/app/apps/frontend/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- net
ports:
- "5173:5173" # Vite dev server
- "3000:3000" # 백엔드 API 포트
websocket:
build:
context: .
dockerfile: ./services/websocket/Dockerfile.local
image: websocket:latest
env_file:
- .env
volumes:
- .env:/app/.env
# 소스 코드 마운트
- ./apps/websocket:/app/apps/websocket
# 의존성 캐시를 위한 볼륨
- websocket_node_modules:/app/node_modules
- websocket_app_node_modules:/app/apps/websocket/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- net
ports:
- "4242:4242" # WebSocket 포트
nginx:
build:
context: .
dockerfile: ./services/nginx/Dockerfile.local
ports:
- "80:80"
- "443:443"
depends_on:
- backend
- websocket
networks:
- net
volumes:
- type: bind
source: ./services/nginx/ssl
target: /etc/nginx/ssl
bind:
create_host_path: true
propagation: rprivate
- ./services/nginx/conf.d:/etc/nginx/conf.d
networks:
net:
volumes:
postgres_data:
backend_node_modules:
backend_app_node_modules:
frontend_app_node_modules:
websocket_node_modules:
websocket_app_node_modules: