-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
98 lines (94 loc) ยท 3.9 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
name: sembot
services:
mongo:
image: mongo:latest # MongoDB ๊ณต์ ์ด๋ฏธ์ง ์ฌ์ฉ
container_name: sembot-mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME} # ๊ด๋ฆฌ์ ์ฌ์ฉ์ ์ด๋ฆ
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD} # ๊ด๋ฆฌ์ ๋น๋ฐ๋ฒํธ
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE} # ๊ธฐ๋ณธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ด๋ฆ
ports:
- ${MONGO_BINDING_PORT}:${MONGO_PORT} # MongoDB ๊ธฐ๋ณธ ํฌํธ ๋งตํ (๋ก์ปฌ:์ปจํ
์ด๋)
volumes:
- mongo-data:/data/db # ๋ฐ์ดํฐ ์์์ฑ ๋ณด์ฅ (๋ก์ปฌ ๋ณผ๋ฅจ ์ฌ์ฉ)
# healthcheck:
# test: echo 'db.runCommand("ping").ok' | mongo mongo:${MONGO_PORT}/${MONGO_INITDB_DATABASE} --quiet
# retries: 3 # ์คํจ ์ ์ฌ์๋ ํ์ (3ํ)
# timeout: 10s # ํฌ์ค ์ฒดํฌ ์๋ต ๋๊ธฐ ์๊ฐ
# start_period: 5s # ์ปจํ
์ด๋ ์์ ํ ์ฒซ ๋ฒ์งธ ํฌ์ค ์ฒดํฌ๊น์ง ๊ธฐ๋ค๋ฆด ์๊ฐ
networks: #์ฌ์ฉํ ๋คํธ์ํฌ ์ง์
- sembot-network
mysql:
image: mysql:latest #๋ถ๋ฌ์ฌ image
container_name: sembot-mysql #container ์ด๋ฆ ์ง์
environment: # ํ๊ฒฝ ์ค์
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- TZ=Asia/Seoul
ports:
- ${MYSQL_BINDING_PORT}:${MYSQL_PORT}
volumes: #๋ณผ๋ฅจ ์ง์
- mysql-data:/var/lib/mysql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$$MYSQL_ROOT_PASSWORD']
retries: 3 # ์คํจ ์ ์ฌ์๋ ํ์ (3ํ)
timeout: 10s
start_period: 5s # ์ปจํ
์ด๋ ์์ ํ ์ฒซ ๋ฒ์งธ ํฌ์ค ์ฒดํฌ๊น์ง ๊ธฐ๋ค๋ฆด ์๊ฐ
networks: #์ฌ์ฉํ ๋คํธ์ํฌ ์ง์
- sembot-network
backend:
container_name: sembot-backend
build:
context: ./backend # ํ์ฌ ๋๋ ํ ๋ฆฌ์์ ๋น๋ (Dockerfile ์์น)
dockerfile: Dockerfile # Dockerfile์ ๊ฒฝ๋ก, ๊ธฐ๋ณธ๊ฐ์ 'Dockerfile'
environment:
- TZ=Asia/Seoul
- SERVER_PORT=${BACKEND_PORT}
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:${MYSQL_PORT}/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=${MYSQL_ROOT_PASSWORD}
- SPRING_DATA_REDIS_HOST=${SPRING_DATA_REDIS_HOST}
- SPRING_DATA_REDIS_PORT=${REDIS_PORT}
- SPRING_DATA_MONGODB_URL=mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo:${MONGO_PORT}/${MONGO_INITDB_DATABASE}?authSource=admin
- CORS_ORIGIN_DEVELOPMENT=${CORS_ORIGIN_DEVELOPMENT}
- CORS_ORIGIN_PRODUCTION=${CORS_ORIGIN_PRODUCTION}
- FILE_UPLOAD_PATH=${FILE_UPLOAD_PATH}
- JWT_ACCESS_SECRET=${JWT_ACCESS_SECRET}
- JWT_ACCESS_TOKEN_EXPIRATION=${JWT_ACCESS_TOKEN_EXPIRATION}
- JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET}
- JWT_REFRESH_TOKEN_EXPIRATION=${JWT_REFRESH_TOKEN_EXPIRATION}
- AI_BASE_URL=${AI_BASE_URL}
volumes:
- /files:${FILE_UPLOAD_PATH} # ๋ฐ์ดํฐ ์์์ฑ ๋ณด์ฅ (๋ก์ปฌ ๋ณผ๋ฅจ ์ฌ์ฉ)
ports:
- '${BACKEND_PORT}:${BACKEND_PORT}'
depends_on:
mysql:
condition: service_healthy
mongo:
condition: service_started
networks:
- sembot-network
frontend:
container_name: sembot-frontend
build:
context: ./frontend/chatbot # ํ์ฌ ๋๋ ํ ๋ฆฌ์์ ๋น๋ (Dockerfile ์์น)
dockerfile: Dockerfile # Dockerfile์ ๊ฒฝ๋ก, ๊ธฐ๋ณธ๊ฐ์ 'Dockerfile'
args: # ๋น๋ ์ ํ๊ฒฝ๋ณ์ ์ ๋ฌ
- VITE_BACKEND_URL=${VITE_BACKEND_URL}
- VITE_AI_URL=${VITE_AI_URL}
networks:
- sembot-network
environment:
- TZ=Asia/Seoul
ports:
- '${FRONTEND_BINDING_PORT}:${FRONTEND_PORT}'
networks:
sembot-network:
driver: bridge
volumes:
redis-data:
mongo-data:
mysql-data: