Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
168 lines (159 loc) · 4.62 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
168 lines (159 loc) · 4.62 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
159
160
161
162
163
164
165
166
167
168
services:
# 기존 서비스들...
zookeeper:
image: confluentinc/cp-zookeeper:7.0.0
container_name: challenge_zookeeper
ports:
- "2181:2181"
environment:
- ZOOKEEPER_CLIENT_PORT=2181
- ZOOKEEPER_TICK_TIME=2000
restart: unless-stopped
kafka:
image: confluentinc/cp-kafka:latest
container_name: challenge_kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9093:9093"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
restart: unless-stopped
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: challenge_kafka_ui
depends_on:
- kafka
ports:
- "8080:8080"
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
restart: unless-stopped
mariadb:
image: mariadb:10.6
container_name: challenge_db
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=challenge_db
- MYSQL_USER=challenge_user
- MYSQL_PASSWORD=challenge_password
volumes:
- mariadb_data:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: unless-stopped
# 모니터링 스택 추가
prometheus:
image: prom/prometheus:latest
container_name: challenge_prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
ports:
- "9090:9090"
volumes:
- ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
restart: unless-stopped
loki:
image: grafana/loki:2.9.0
ports:
- "3100:3100"
volumes:
- ./configs/loki/local-config.yaml:/etc/loki/local-config.yaml
- ./loki_data:/loki
- ./loki_wal:/wal
command:
- "-config.file=/etc/loki/local-config.yaml"
- "-config.expand-env=true"
user: "10001:10001" # Explicitly set user
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: challenge_grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./configs/grafana/provisioning:/etc/grafana/provisioning
- ./configs/grafana/dashboards:/etc/grafana/dashboards
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
- loki
restart: unless-stopped
challenge-operator:
image: hexactf/challenge-operator:latest
network_mode: "host"
volumes:
- type: bind
source: ${HOME}/.kube/config
target: /home/nonroot/.kube/config
read_only: true
environment:
DEVELOPMENT: "true"
METRICS_ADDR: ":8079"
KAFKA_BROKERS: "localhost:9093"
LOG_LEVEL: "debug"
KUBECONFIG: "/home/nonroot/.kube/config"
depends_on:
- kafka
app:
image: hexactf/challenge-api:latest
container_name: challenge_app
network_mode: "host"
environment:
- FLASK_ENV=development
# Database
- DB_HOST=127.0.0.1
- DB_PORT=3306
- DB_NAME=challenge_db
- DB_USER=challenge_user
- DB_PASSWORD=challenge_password
- DB_POOL_SIZE=5
- DB_MAX_OVERFLOW=10
# Security
- SECRET_KEY=your-super-secret-key-here
# Kafka
- KAFKA_BOOTSTRAP_SERVERS=127.0.0.1:9093
- KAFKA_TOPIC=challenge-status
- KAFKA_GROUP_ID=challenge-consumer-group
# Loki 설정 추가
- LOKI_URL=http://127.0.0.1:3100/loki/api/v1/push
- LOKI_PROTOCOL=http
- LOKI_HOST=127.0.0.1
- LOKI_PORT=3100
- LOKI_PATH=/loki/api/v1/push
- LOG_LEVEL=INFO
- APP_NAME=challenge-service
- ENVIRONMENT=development
- KUBECONFIG=/root/.kube/config
volumes:
- ${HOME}/.kube/config:/root/.kube/config:ro
depends_on:
- mariadb
- kafka
- loki
restart: unless-stopped
volumes:
mariadb_data:
prometheus_data:
grafana_data:
loki_data:
loki_wal: # WAL 볼륨 추가