Repository navigation
Expand file tree
/
Copy pathdocker-compose-local.yml
More file actions
97 lines (92 loc) · 2.48 KB
/
Copy pathdocker-compose-local.yml
File metadata and controls
97 lines (92 loc) · 2.48 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
db:
image: mysql:8.0
container_name: eryuk-mysql
env_file:
- ./be/.env.development
ports:
- "3307:3306"
volumes:
# MySQL 데이터 영속성을 위한 볼륨
- mysql_data:/var/lib/mysql
# MySQL 초기화 스크립트 (컨테이너가 처음 시작될 때만 실행됨)
- ./infra/mysql/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
networks:
- eryuk_network
redis:
image: redis:7-alpine
container_name: eryuk-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- eryuk_network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
server:
build:
context: .
dockerfile: be/Dockerfile
container_name: eryuk-server
working_dir: /app/be
env_file:
- ./be/.env.development
environment:
CHOKIDAR_USEPOLLING: 'true'
WATCHPACK_POLLING: 'true'
command: pnpm dev
ports:
- '4000:4000'
- '20000-20020:20000-20020/udp'
- '20000-20020:20000-20020/tcp'
volumes:
- ./be:/app/be:cached # 소스만 부분 바인드
- /app/be/node_modules # 컨테이너 내 설치본 유지 (호스트 node_modules 가림 방지)
depends_on:
db:
condition: service_started
redis:
condition: service_healthy
networks:
- eryuk_network
client:
build:
context: .
dockerfile: fe/Dockerfile
container_name: eryuk-client
working_dir: /app
command: pnpm --filter fe dev
env_file:
- ./fe/.env.development
environment:
NODE_ENV: development
# 파일 감시를 위한 환경 변수 (Docker 환경에서 핫 리로드 지원)
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
# Next.js Fast Refresh 활성화
WATCHPACK_WATCHER_LIMIT: "20"
ports:
- "3000:3000" # Next.js 기본 포트
volumes:
- ./fe:/app/fe:cached # 소스만 부분 바인드
- /app/fe/.next # .next 디렉토리는 컨테이너 내부에만 저장 (성능 향상)
- /app/fe/node_modules # node_modules는 컨테이너 내부에만 저장
networks:
- eryuk_network
networks:
eryuk_network:
driver: bridge
volumes:
redis_data:
mysql_data: