|
1 | 1 | version: "3.8" |
2 | 2 |
|
3 | 3 | services: |
4 | | - postgres: |
5 | | - image: postgres:16-alpine |
6 | | - environment: |
7 | | - POSTGRES_USER: ${DB_USER} |
8 | | - POSTGRES_PASSWORD: ${DB_PASSWORD} |
9 | | - POSTGRES_DB: ${DB_NAME} |
10 | | - volumes: |
11 | | - - postgres_data:/var/lib/postgresql/data |
12 | | - networks: |
13 | | - - net |
14 | | - healthcheck: |
15 | | - test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] |
16 | | - interval: 10s |
17 | | - timeout: 5s |
18 | | - retries: 5 |
19 | | - ports: |
20 | | - - "5432:5432" |
| 4 | + postgres: |
| 5 | + image: postgres:16-alpine |
| 6 | + environment: |
| 7 | + POSTGRES_USER: ${DB_USER} |
| 8 | + POSTGRES_PASSWORD: ${DB_PASSWORD} |
| 9 | + POSTGRES_DB: ${DB_NAME} |
| 10 | + volumes: |
| 11 | + - postgres_data:/var/lib/postgresql/data |
| 12 | + networks: |
| 13 | + - net |
| 14 | + healthcheck: |
| 15 | + test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] |
| 16 | + interval: 10s |
| 17 | + timeout: 5s |
| 18 | + retries: 5 |
| 19 | + ports: |
| 20 | + - "5432:5432" |
21 | 21 |
|
22 | | - redis: |
23 | | - image: redis:latest |
24 | | - environment: |
25 | | - REDIS_HOST: ${REDIS_HOST} |
26 | | - REDIS_PORT: ${REDIS_PORT} |
27 | | - networks: |
28 | | - - net |
29 | | - ports: |
30 | | - - "6379:6379" |
31 | | - healthcheck: |
32 | | - test: ["CMD", "redis-cli", "ping"] |
33 | | - interval: 30s |
34 | | - retries: 3 |
35 | | - start_period: 10s |
36 | | - timeout: 5s |
| 22 | + redis: |
| 23 | + image: redis:latest |
| 24 | + environment: |
| 25 | + REDIS_HOST: ${REDIS_HOST} |
| 26 | + REDIS_PORT: ${REDIS_PORT} |
| 27 | + networks: |
| 28 | + - net |
| 29 | + ports: |
| 30 | + - "6379:6379" |
| 31 | + healthcheck: |
| 32 | + test: ["CMD", "redis-cli", "ping"] |
| 33 | + interval: 30s |
| 34 | + retries: 3 |
| 35 | + start_period: 10s |
| 36 | + timeout: 5s |
37 | 37 |
|
38 | | - backend: |
39 | | - build: |
40 | | - context: . |
41 | | - dockerfile: ./services/backend/Dockerfile.local |
42 | | - image: backend:latest |
43 | | - env_file: |
44 | | - - .env |
45 | | - volumes: |
46 | | - - .env:/app/.env |
47 | | - # 소스 코드 마운트 |
48 | | - - ./apps/backend:/app/apps/backend |
49 | | - - ./apps/frontend:/app/apps/frontend |
50 | | - # 의존성 캐시를 위한 볼륨 |
51 | | - - backend_node_modules:/app/node_modules |
52 | | - - backend_app_node_modules:/app/apps/backend/node_modules |
53 | | - - frontend_app_node_modules:/app/apps/frontend/node_modules |
54 | | - depends_on: |
55 | | - postgres: |
56 | | - condition: service_healthy |
57 | | - redis: |
58 | | - condition: service_healthy |
59 | | - networks: |
60 | | - - net |
61 | | - ports: |
62 | | - - "5173:5173" # Vite dev server |
63 | | - - "3000:3000" # 백엔드 API 포트 |
| 38 | + backend: |
| 39 | + build: |
| 40 | + context: . |
| 41 | + dockerfile: ./services/backend/Dockerfile.local |
| 42 | + image: backend:latest |
| 43 | + env_file: |
| 44 | + - .env |
| 45 | + volumes: |
| 46 | + - .env:/app/.env |
| 47 | + - ./apps/backend:/app/apps/backend |
| 48 | + - ./apps/frontend:/app/apps/frontend |
| 49 | + - root_node_modules:/app/node_modules |
| 50 | + - backend_app_node_modules:/app/apps/backend/node_modules |
| 51 | + - frontend_app_node_modules:/app/apps/frontend/node_modules |
| 52 | + depends_on: |
| 53 | + postgres: |
| 54 | + condition: service_healthy |
| 55 | + redis: |
| 56 | + condition: service_healthy |
| 57 | + networks: |
| 58 | + - net |
| 59 | + ports: |
| 60 | + - "5173:5173" # Vite dev server |
| 61 | + - "3000:3000" # 백엔드 API 포트 |
| 62 | + entrypoint: | |
| 63 | + sh -c " |
| 64 | + yarn install && |
| 65 | + yarn dev |
| 66 | + " |
64 | 67 |
|
65 | | - websocket: |
66 | | - build: |
67 | | - context: . |
68 | | - dockerfile: ./services/websocket/Dockerfile.local |
69 | | - image: websocket:latest |
70 | | - env_file: |
71 | | - - .env |
72 | | - volumes: |
73 | | - - .env:/app/.env |
74 | | - # 소스 코드 마운트 |
75 | | - - ./apps/websocket:/app/apps/websocket |
76 | | - # 의존성 캐시를 위한 볼륨 |
77 | | - - websocket_node_modules:/app/node_modules |
78 | | - - websocket_app_node_modules:/app/apps/websocket/node_modules |
79 | | - depends_on: |
80 | | - postgres: |
81 | | - condition: service_healthy |
82 | | - redis: |
83 | | - condition: service_healthy |
84 | | - networks: |
85 | | - - net |
86 | | - ports: |
87 | | - - "4242:4242" # WebSocket 포트 |
| 68 | + websocket: |
| 69 | + build: |
| 70 | + context: . |
| 71 | + dockerfile: ./services/websocket/Dockerfile.local |
| 72 | + image: websocket:latest |
| 73 | + env_file: |
| 74 | + - .env |
| 75 | + volumes: |
| 76 | + - .env:/app/.env |
| 77 | + - ./apps/websocket:/app/apps/websocket |
| 78 | + - root_node_modules:/app/node_modules |
| 79 | + - websocket_app_node_modules:/app/apps/websocket/node_modules |
| 80 | + depends_on: |
| 81 | + postgres: |
| 82 | + condition: service_healthy |
| 83 | + redis: |
| 84 | + condition: service_healthy |
| 85 | + networks: |
| 86 | + - net |
| 87 | + ports: |
| 88 | + - "4242:4242" # WebSocket 포트 |
| 89 | + entrypoint: | |
| 90 | + sh -c " |
| 91 | + yarn install && |
| 92 | + yarn dev |
| 93 | + " |
88 | 94 |
|
89 | | - nginx: |
90 | | - build: |
91 | | - context: . |
92 | | - dockerfile: ./services/nginx/Dockerfile.local |
93 | | - ports: |
94 | | - - "80:80" |
95 | | - - "443:443" |
96 | | - depends_on: |
97 | | - - backend |
98 | | - - websocket |
99 | | - networks: |
100 | | - - net |
101 | | - volumes: |
102 | | - - type: bind |
103 | | - source: ./services/nginx/ssl |
104 | | - target: /etc/nginx/ssl |
105 | | - bind: |
106 | | - create_host_path: true |
107 | | - propagation: rprivate |
108 | | - - ./services/nginx/conf.d:/etc/nginx/conf.d |
| 95 | + nginx: |
| 96 | + build: |
| 97 | + context: . |
| 98 | + dockerfile: ./services/nginx/Dockerfile.local |
| 99 | + ports: |
| 100 | + - "80:80" |
| 101 | + - "443:443" |
| 102 | + depends_on: |
| 103 | + - backend |
| 104 | + - websocket |
| 105 | + networks: |
| 106 | + - net |
| 107 | + volumes: |
| 108 | + - type: bind |
| 109 | + source: ./services/nginx/ssl |
| 110 | + target: /etc/nginx/ssl |
| 111 | + bind: |
| 112 | + create_host_path: true |
| 113 | + propagation: rprivate |
| 114 | + - ./services/nginx/conf.d:/etc/nginx/conf.d |
109 | 115 |
|
110 | 116 | networks: |
111 | | - net: |
| 117 | + net: |
112 | 118 |
|
113 | 119 | volumes: |
114 | | - postgres_data: |
115 | | - backend_node_modules: |
116 | | - backend_app_node_modules: |
117 | | - frontend_app_node_modules: |
118 | | - websocket_node_modules: |
119 | | - websocket_app_node_modules: |
| 120 | + postgres_data: |
| 121 | + root_node_modules: |
| 122 | + backend_node_modules: |
| 123 | + backend_app_node_modules: |
| 124 | + frontend_app_node_modules: |
| 125 | + websocket_node_modules: |
| 126 | + websocket_app_node_modules: |
0 commit comments