-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
158 lines (149 loc) · 3.84 KB
/
docker-compose.dev.yml
File metadata and controls
158 lines (149 loc) · 3.84 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: dev-infra
services:
spring-api:
build:
context: .
dockerfile: mopl-core/Dockerfile
container_name: spring-api
ports:
- "8080:8080" # OAuth때문에 spring-api만 허용
env_file:
- ./mopl-core/.env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
websocket-server:
build:
context: .
dockerfile: mopl-websocket-sse/Dockerfile
container_name: websocket-server
env_file:
- ./mopl-websocket-sse/.env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
nginx:
image: nginx:alpine
container_name: nginx
ports:
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/static:/usr/share/nginx/html:ro
depends_on:
- spring-api
- websocket-server
networks:
- app-network
restart: unless-stopped
redis:
image: redis:7.4-alpine
container_name: dev-redis
command: [ "redis-server", "--appendonly", "yes" ]
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- app-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
postgres:
image: postgres:17-alpine
container_name: dev-postgres
environment:
POSTGRES_DB: app
POSTGRES_USER: app
POSTGRES_PASSWORD: app1234
TZ: Asia/Seoul
ports:
- "5433:5432"
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U app" ]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
elasticsearch:
build:
context: .
dockerfile: DockerFile-ElasticSearch
container_name: dev-elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.enrollment.enabled=false
- ES_JAVA_OPTS=-Xms1g -Xmx1g
- TZ=Asia/Seoul
ports:
- "9200:9200"
- "9300:9300"
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- app-network
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"\\|\"status\":\"yellow\"'" ]
interval: 10s
timeout: 10s
retries: 10
start_period: 60s
kafka:
image: apache/kafka:4.1.1
container_name: dev-kafka
ports:
- "9092:9092"
- "29092:29092"
environment:
- TZ=Asia/Seoul
- KAFKA_NODE_ID=1
- KAFKA_PROCESS_ROLES=broker,controller
- KAFKA_LISTENERS=PLAINTEXT://:29092,PLAINTEXT_HOST://:9092,CONTROLLER://:9093
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://dev-kafka:29092,PLAINTEXT_HOST://localhost:9092
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CONTROLLER_QUORUM_VOTERS=1@dev-kafka:9093
- KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
- KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
- KAFKA_TOPICS_NOTIFICATIONS=notification.events
volumes:
- kafka_data:/var/lib/kafka/data
networks:
- app-network
restart: unless-stopped
volumes:
redis_data:
pg_data:
es_data:
kafka_data:
networks:
app-network:
driver: bridge