-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
65 lines (60 loc) · 1.48 KB
/
docker-compose.yaml
File metadata and controls
65 lines (60 loc) · 1.48 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
version: '3.8'
services:
# MongoDB Service
mongodb:
image: mongo:7.0
container_name: ocw-analysis-db
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: 123456
MONGO_INITDB_DATABASE: UMOCWAnalysis
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
networks:
- mern-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
# Backend Service
backend:
build: ./backend
container_name: ocw-analysis-backend
restart: unless-stopped
ports:
- "5199:5199"
environment:
- FRONTEND_URL=http://localhost:5173
- MONGODB_CONNECTION_STRING=mongodb://admin:123456@mongodb:27017/UMOCWAnalysis?authSource=admin&retryWrites=true&w=majority
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
depends_on:
mongodb:
condition: service_healthy
networks:
- mern-network
# Frontend Service
frontend:
build: ./frontend
container_name: ocw-analysis-frontend
restart: unless-stopped
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
networks:
- mern-network
networks:
mern-network:
driver: bridge
volumes:
mongodb_data:
driver: local
mongodb_config:
driver: local