-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
98 lines (91 loc) · 2.62 KB
/
docker-compose.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
version: '3.8'
services:
nginx:
image: nginx:alpine
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx/proxy.conf:/etc/nginx/conf.d/default.conf
# SSL 인증서가 필요한 경우 아래 주석 해제
# - ./ssl:/etc/nginx/ssl
depends_on:
- frontend
- backend
networks:
- booquiz
restart: unless-stopped
frontend:
container_name: booquiz-frontend
image: ${DOCKER_USERNAME}/booquiz-frontend:${DOCKER_TAG}
build:
context: .
dockerfile: apps/frontend/Dockerfile
args:
- VITE_API_URL=/api
- VITE_WS_URL=/ws
expose:
- '80'
networks:
- booquiz
restart: unless-stopped
backend:
container_name: booquiz-backend
image: ${DOCKER_USERNAME}/booquiz-backend:${DOCKER_TAG}
build:
context: .
dockerfile: apps/backend/Dockerfile
args:
- NODE_ENV=${NODE_ENV}
- SESSION_SECRET=${SESSION_SECRET}
- MYSQL_HOST=mysql
- DB_PORT=${DB_PORT}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=${DB_DATABASE}
- DB_SYNCHRONIZE=${DB_SYNCHRONIZE}
- REDIS_HOST=redis
- REDIS_PORT=6379
expose:
- '3000'
depends_on:
- mysql
- redis
networks:
- booquiz
restart: unless-stopped
mysql:
image: mysql:8
container_name: booquiz-mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
- ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
expose:
- '3306'
networks:
- booquiz
restart: unless-stopped
redis:
image: redis:alpine
container_name: booquiz-redis
command: redis-server --appendonly yes # 데이터 지속성을 위한 AOF 활성화
volumes:
- redis_data:/data # Redis 데이터 보존
expose:
- '6379'
networks:
- booquiz
restart: unless-stopped
networks:
booquiz:
name: booquiz
volumes:
mysql_data:
name: booquiz-mysql-data
redis_data:
name: booquiz-redis-data