-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
80 lines (74 loc) · 2.01 KB
/
docker-compose.prod.yml
File metadata and controls
80 lines (74 loc) · 2.01 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
# Production override
# 사용법: docker compose -f docker-compose.yml -f docker-compose.prod.yml up
services:
# Spring API (운영 설정 오버라이드)
widyu-api:
container_name: widyu-api-prod
restart: always
environment:
# Profile
SPRING_PROFILES_ACTIVE: prod
# Database (RDS)
MYSQL_HOST: ${RDS_ENDPOINT}
MYSQL_PORT: ${RDS_PORT}
MYSQL_USERNAME: ${RDS_USERNAME}
MYSQL_PASSWORD: ${RDS_PASSWORD}
# JVM Options (운영 환경)
JAVA_OPTS: >
-Xms1024m
-Xmx2048m
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/app/logs/heap_dump.hprof
-Dfile.encoding=UTF-8
-Duser.timezone=Asia/Seoul
ports:
- "8080:8080"
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s # 운영 환경은 시작 시간 더 길게
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
# Redis (운영 설정)
redis:
container_name: widyu-redis-prod
restart: always
command: >
redis-server
--requirepass ${REDIS_PASSWORD}
--maxmemory 512mb
--maxmemory-policy allkeys-lru
--appendonly yes
--save 900 1
--save 300 10
--save 60 10000
ports:
- "127.0.0.1:${REDIS_PORT}:6379" # 내부 접근만
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD}", "ping"]
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Nginx (운영 설정)
nginx:
container_name: widyu-nginx-prod
restart: always
volumes:
- ./nginx/ssl:/etc/nginx/ssl:ro # SSL 인증서
logging:
driver: "json-file"
options:
max-size: "20m"
max-file: "5"