-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
146 lines (138 loc) · 3.83 KB
/
docker-compose.prod.yml
File metadata and controls
146 lines (138 loc) · 3.83 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
# ===========================================
# ISMS Backend - 本番環境用 Docker Compose
# ===========================================
# 本番環境での使用を想定した設定です
version: '3.8'
services:
# バックエンドサービス
backend:
build:
context: .
dockerfile: Dockerfile
container_name: isms-backend-prod
ports:
- "8080:8080"
environment:
# 本番環境設定(環境変数で上書き)
- APP_ENV=production
- DATABASE_PATH=/app/data/isms.db
- DATABASE_TYPE=sqlite
- SERVER_PORT=8080
# 以下は実際の環境変数で設定してください
- FRONTEND_URL=${FRONTEND_URL:-https://your-domain.com}
- JWT_SECRET=${JWT_SECRET}
- CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-https://your-domain.com}
- SAML_CERTIFICATE_PATH=${SAML_CERTIFICATE_PATH:-}
- SAML_PRIVATE_KEY_PATH=${SAML_PRIVATE_KEY_PATH:-}
volumes:
# データベースファイルを永続化
- isms-data:/app/data
# SAML証明書をマウント(必要に応じて)
- ${SAML_CERTS_PATH:-./certs}:/app/certs:ro
networks:
- isms-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
restart: always
# リソース制限
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
# フロントエンドサービス
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=${FRONTEND_API_URL:-https://api.your-domain.com}
- VITE_IS_DEVELOPMENT=false
container_name: isms-frontend-prod
ports:
- "80:3000"
depends_on:
backend:
condition: service_healthy
networks:
- isms-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
restart: always
# リソース制限
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
# リバースプロキシ(本番環境用)
nginx:
image: nginx:alpine
container_name: isms-nginx-prod
ports:
- "443:443"
- "80:80"
volumes:
- ./nginx/prod.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- frontend
- backend
networks:
- isms-network
restart: always
profiles:
- nginx # docker-compose --profile nginx up で起動
# ログ収集(本番環境用)
log-collector:
image: fluent/fluent-bit:latest
container_name: isms-logs
volumes:
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- ./fluent-bit/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro
networks:
- isms-network
profiles:
- logging # docker-compose --profile logging up で起動
restart: always
# メトリクス監視(本番環境用)
prometheus:
image: prom/prometheus:latest
container_name: isms-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- isms-network
profiles:
- monitoring # docker-compose --profile monitoring up で起動
restart: always
# ネットワーク設定
networks:
isms-network:
driver: bridge
name: isms-network-prod
# ボリューム設定
volumes:
isms-data:
driver: local
name: isms-data-prod
prometheus-data:
driver: local
name: prometheus-data