@@ -7,31 +7,6 @@ networks:
77
88services :
99
10- # ┌────────────────────────────────────────────────────────────────────────┐
11- # │ 3) MySQL 서비스 정의 │
12- # │ - 애플리케이션 데이터베이스로 사용되며, 포트 3306으로 외부와 통신합니다. │
13- # │ - 로컬 디렉토리를 볼륨으로 마운트해 데이터 영속화를 보장합니다. │
14- # └────────────────────────────────────────────────────────────────────────┘
15- mysql :
16- image : mysql:8.0 # MySQL 8.0 이미지를 사용 :contentReference[oaicite:20]{index=20}
17- container_name : hhplus-mysql # 컨테이너 이름을 hhplus-mysql로 지정 :contentReference[oaicite:21]{index=21}
18- ports :
19- - " 3306:3306" # 호스트 3306 → 컨테이너 3306 :contentReference[oaicite:22]{index=22}
20- environment : # 환경 변수는 매핑(mapping) 형태로 작성 :contentReference[oaicite:23]{index=23}
21- MYSQL_ROOT_PASSWORD : root # 루트 사용자 비밀번호 :contentReference[oaicite:24]{index=24}
22- MYSQL_USER : application # 애플리케이션 전용 사용자 이름 :contentReference[oaicite:25]{index=25}
23- MYSQL_PASSWORD : application # 애플리케이션 전용 비밀번호 :contentReference[oaicite:26]{index=26}
24- MYSQL_DATABASE : hhplus
25- restart : always
26- # 초기 생성할 데이터베이스 이름 :contentReference[oaicite:27]{index=27}
27- volumes :
28- - ./data/mysql/:/var/lib/mysql # 호스트 ./data/mysql/ → 컨테이너 /var/lib/mysql (영속화) :contentReference[oaicite:28]{index=28}
29- networks :
30- - monitoring
31- mem_limit : 1g # 이 컨테이너가 사용할 수 있는 최대 메모리 → 1GB
32- cpus : 0.5 # 이 컨테이너가 최대 0.5 CPU 코어(50%) 사용 가능
33-
34-
3510 # ┌────────────────────────────────────────────────────────────────────────┐
3611 # │ 4) Kafka 서비스 정의 │
3712 # │ - 메시지 브로커로 사용되며, 포트 9094로 외부와 통신합니다. │
@@ -86,12 +61,11 @@ services:
8661 dockerfile : Dockerfile
8762 image : hhplus-app # 사용자 정의 이미지 이름을 hhplus-app으로 지정 :contentReference[oaicite:48]{index=48}
8863 depends_on :
89- - mysql
9064 - kafka
9165 - redis
9266 # - influxdb # InfluxDB가 반드시 기동된 이후에 애플리케이션이 구동되도록 설정 :contentReference[oaicite:49]{index=49}
93- environment : # Spring Boot 환경 변수는 매핑(mapping) 형태로 작성 :contentReference[oaicite:50]{index=50}
94- SPRING_PROFILES_ACTIVE : docker # 활성화할 Spring 프로필을 local로 지정 :contentReference[oaicite:51]{index=51} # Kafka bootstrap 서버를 kafka 서비스로 지정 :contentReference[oaicite:57]{index=57}
67+ environment : # Spring Boot 환경 변수는 매핑(mapping) 형태로 작성
68+ SPRING_PROFILES_ACTIVE : docker # 활성화 할 프로파일을 docker로 지정함.
9569 restart : always
9670 ports :
9771 - " 8082:8082" # 호스트 8082 → 컨테이너 8082 :contentReference[oaicite:62]{index=62}
0 commit comments