-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (120 loc) · 2.98 KB
/
docker-compose.yml
File metadata and controls
127 lines (120 loc) · 2.98 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
version: '3.8'
services:
# MongoDB データベース
mongodb:
image: mongo:7.0
container_name: callguard-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-password123}
MONGO_INITDB_DATABASE: ${MONGO_DB_NAME:-callguard}
ports:
- '27017:27017'
volumes:
- mongodb_data:/data/db
- ./backend/src/utils/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
networks:
- callguard-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# バックエンド API サーバー
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: development
container_name: callguard-backend
restart: unless-stopped
environment:
NODE_ENV: development
PORT: 3000
MONGODB_URI: mongodb://admin:password123@mongodb:27017/callguard?authSource=admin
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key}
CORS_ORIGIN: http://localhost:8081
ports:
- '3000:3000'
volumes:
- ./backend:/app
- /app/node_modules
depends_on:
mongodb:
condition: service_healthy
networks:
- callguard-network
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# フロントエンド Web アプリ
frontend:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: callguard-frontend
restart: unless-stopped
environment:
EXPO_DEVTOOLS_LISTEN_ADDRESS: 0.0.0.0
ports:
- '8081:8081'
volumes:
- .:/app
- /app/node_modules
depends_on:
- backend
networks:
- callguard-network
stdin_open: true
tty: true
# Redis (キャッシュ・セッション管理)
redis:
image: redis:7-alpine
container_name: callguard-redis
restart: unless-stopped
ports:
- '6379:6379'
volumes:
- redis_data:/data
networks:
- callguard-network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 30s
timeout: 10s
retries: 3
# Nginx (リバースプロキシ・ロードバランサー)
nginx:
image: nginx:alpine
container_name: callguard-nginx
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend
networks:
- callguard-network
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost/health']
interval: 30s
timeout: 10s
retries: 3
volumes:
mongodb_data:
driver: local
redis_data:
driver: local
networks:
callguard-network:
driver: bridge