-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (50 loc) ยท 1.95 KB
/
docker-compose.yml
File metadata and controls
53 lines (50 loc) ยท 1.95 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
services:
app:
image: imjuyongp/setbangsari:latest
ports:
- "8080:8080" # ํธ์คํธ์ 8080 ํฌํธ๋ฅผ ์ปจํ
์ด๋์ 8080 ํฌํธ์ ๋งคํ
env_file:
- .env
environment:
- SPRING_PROFILES_ACTIVE=prod
- TZ=Asia/Seoul
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command:
- java -Duser.timezone=Asia/Seoul -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} -jar app.jar
# ์คํ ๋ช
๋ น์ด: jar ํ์ผ์ ์คํํ๋ฉด์ Spring ํ๋กํ ํ์ฑํ
depends_on:
- mysql # ์ด ์๋น์ค๊ฐ mysql์ด ๋จผ์ ์คํ๋ ํ ์์๋๋๋ก
networks:
- cesco-network # mysql๊ณผ ๊ฐ์ ๋คํธ์ํฌ๋ฅผ ๊ณต์
mysql:
image: mysql:8.0 # ๊ณต์ MySQL 8.0 ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉ
ports:
- "3306:3306" # ํธ์คํธ์ ์ปจํ
์ด๋์ MySQL ํฌํธ๋ฅผ ๋งคํ
environment:
- MYSQL_DATABASE=setbangsari # ์ด๊ธฐ ์์ฑ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ด๋ฆ
- MYSQL_USER=cesco
- MYSQL_PASSWORD=cesco07
- MYSQL_ROOT_PASSWORD=1234 # ๋ฃจํธ ๊ณ์ ์ ๋น๋ฐ๋ฒํธ
- TZ=Asia/Seoul
- JAVA_OPTS=-Duser.timezone=Asia/Seoul
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
- --init-connect=SET NAMES utf8mb4
- --default-time-zone=+09:00
volumes:
- mysql-data:/var/lib/mysql
# MySQL์ ๋ฐ์ดํฐ ํ์ผ์ ํธ์คํธ์ ๋ณผ๋ฅจ์ผ๋ก ์๊ตฌ ์ ์ฅ
# ์ปจํ
์ด๋๊ฐ ์ญ์ ๋ผ๋ DB ๋ด์ฉ์ ์ ์ง๋จ
- /etc/localtime:/etc/localtime:ro #
- /etc/timezone:/etc/timezone:ro
networks:
- cesco-network # Spring๊ณผ ๊ฐ์ ๋คํธ์ํฌ ์์ ์์ด์ mysql์ด๋ผ๋ ํธ์คํธ ์ด๋ฆ์ผ๋ก ์ ๊ทผ ๊ฐ๋ฅ
networks:
cesco-network:
driver: bridge # Docker ๊ธฐ๋ณธ ๋ธ๋ฆฌ์ง ๋คํธ์ํฌ๋ฅผ ์ฌ์ฉ
volumes:
mysql-data: # ์์์ ์ ์ํ MySQL ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ๋ณผ๋ฅจ