forked from TEAM-ONLY-4/Only_4_kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (25 loc) · 926 Bytes
/
docker-compose.yml
File metadata and controls
32 lines (25 loc) · 926 Bytes
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
version: '3.8'
services:
consumer-app:
ports:
- "8081:8081"
# 1. 내 프로젝트를 이미지로 빌드
build: .
container_name: only4_kafka_consumer
# 2. 실행 후 자동으로 꺼지지 않게 설정
restart: always
env_file:
- .env
# 3. 환경 변수 덮어쓰기
environment:
SPRING_KAFKA_BOOTSTRAP_SERVERS: host.docker.internal:9092
# [DB 주소 변경]
SPRING_DATASOURCE_URL: jdbc:postgresql://host.docker.internal:5432/${POSTGRES_DB}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
# [프로파일 설정]
# 배포 환경임을 알려주기 위해 prod로 설정하는 경우가 많음
SPRING_PROFILES_ACTIVE: prod
# 5. 리눅스/Mac 도커에서 호스트(주인님) 컴퓨터를 찾기 위한 설정
extra_hosts:
- "host.docker.internal:host-gateway"