This repository was archived by the owner on Mar 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
229 lines (222 loc) · 6.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
229 lines (222 loc) · 6.28 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# ProxyND Production Docker Compose
version: '3.8'
services:
# ProxyND Main Service
proxynd:
build:
context: .
dockerfile: Dockerfile
args:
- BUILD_DATE=${BUILD_DATE:-$(date -u +'%Y-%m-%dT%H:%M:%SZ')}
- VCS_REF=${VCS_REF:-$(git rev-parse --short HEAD)}
- VERSION=${VERSION:-latest}
image: ${REGISTRY:-local}/proxynd:${TAG:-latest}
container_name: ${COMPOSE_PROJECT_NAME:-proxynd}_app
restart: unless-stopped
ports:
- "${HOST_PORT:-8080}:8080"
volumes:
- config_volume:/config:ro
- storage_volume:/storage
- logs_volume:/var/log/proxynd
# 설정 파일 바인드 마운트 (개발용)
- type: bind
source: ${CONFIG_PATH:-./examples}
target: /config
read_only: true
bind:
create_host_path: true
environment:
- SERVER_PORT=8080
- CONFIG_DIR=/config
- STORAGE_DIR=/storage
- LOG_LEVEL=${LOG_LEVEL:-info}
- LOG_FORMAT=${LOG_FORMAT:-json}
- GOMAXPROCS=${GOMAXPROCS:-0}
- GOMEMLIMIT=${GOMEMLIMIT:-256MiB}
# 프로덕션 설정
- GIN_MODE=${GIN_MODE:-release}
- ENABLE_METRICS=${ENABLE_METRICS:-true}
- ENABLE_HEALTH_DASHBOARD=${ENABLE_HEALTH_DASHBOARD:-true}
networks:
- proxynd-network
healthcheck:
test: ["/app/healthcheck.sh"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETUID
- SETGID
ulimits:
memlock:
soft: 268435456
hard: 268435456
nofile:
soft: 65536
hard: 65536
nproc:
soft: 4096
hard: 4096
deploy:
resources:
limits:
cpus: '${CPU_LIMIT:-1.0}'
memory: ${MEMORY_LIMIT:-512M}
reservations:
cpus: '${CPU_RESERVATION:-0.25}'
memory: ${MEMORY_RESERVATION:-128M}
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
depends_on:
redis:
condition: service_healthy
prometheus:
condition: service_started
labels:
- "traefik.enable=true"
- "traefik.http.routers.proxynd.rule=Host(`${PROXYND_HOST:-localhost}`)"
- "traefik.http.services.proxynd.loadbalancer.server.port=8080"
- "com.proxynd.service=main"
- "com.proxynd.version=${VERSION:-latest}"
# Redis for caching and session management
redis:
image: redis:7.2-alpine
container_name: ${COMPOSE_PROJECT_NAME:-proxynd}_redis
restart: unless-stopped
command: >
redis-server
--appendonly yes
--appendfsync everysec
--maxmemory ${REDIS_MAXMEMORY:-128mb}
--maxmemory-policy allkeys-lru
--tcp-keepalive 300
--timeout 300
volumes:
- redis_data:/data
networks:
- proxynd-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 3s
retries: 3
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
labels:
- "com.proxynd.service=redis"
# Prometheus for metrics collection
prometheus:
image: prom/prometheus:v2.48.0
container_name: ${COMPOSE_PROJECT_NAME:-proxynd}_prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=${PROMETHEUS_RETENTION:-7d}'
- '--web.enable-lifecycle'
- '--web.enable-admin-api'
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
volumes:
- prometheus_data:/prometheus
- ./deployments/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
networks:
- proxynd-network
depends_on:
- proxynd
labels:
- "com.proxynd.service=monitoring"
# Grafana for visualization
grafana:
image: grafana/grafana:10.2.0
container_name: ${COMPOSE_PROJECT_NAME:-proxynd}_grafana
restart: unless-stopped
ports:
- "${GRAFANA_PORT:-3000}:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./deployments/monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./deployments/monitoring/grafana/datasources:/etc/grafana/provisioning/datasources:ro
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin123}
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
- GF_ANALYTICS_REPORTING_ENABLED=false
- GF_ANALYTICS_CHECK_FOR_UPDATES=false
networks:
- proxynd-network
depends_on:
- prometheus
labels:
- "com.proxynd.service=monitoring"
# Nginx for load balancing and SSL termination
nginx:
image: nginx:1.25-alpine
container_name: ${COMPOSE_PROJECT_NAME:-proxynd}_nginx
restart: unless-stopped
ports:
- "${NGINX_HTTP_PORT:-80}:80"
- "${NGINX_HTTPS_PORT:-443}:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- nginx_logs:/var/log/nginx
- ssl_certs:/etc/ssl/certs:ro
networks:
- proxynd-network
depends_on:
- proxynd
labels:
- "com.proxynd.service=proxy"
networks:
proxynd-network:
driver: bridge
name: ${COMPOSE_PROJECT_NAME:-proxynd}_network
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
config_volume:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_config
storage_volume:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_storage
logs_volume:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_logs
redis_data:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_redis
prometheus_data:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_prometheus
grafana_data:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_grafana
nginx_logs:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_nginx_logs
ssl_certs:
driver: local
name: ${COMPOSE_PROJECT_NAME:-proxynd}_ssl_certs