-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (76 loc) · 1.87 KB
/
docker-compose.yml
File metadata and controls
81 lines (76 loc) · 1.87 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:6.0
container_name: task-manager-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: realtime_task_manager
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
networks:
- task-manager-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
# Backend Server
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: task-manager-server
restart: unless-stopped
ports:
- "5000:5000"
environment:
NODE_ENV: production
PORT: 5000
MONGO_URI: mongodb://admin:password123@mongodb:27017/realtime_task_manager?authSource=admin
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key-change-in-production}
JWT_EXPIRE: 30d
CORS_ORIGIN: http://localhost:5173
depends_on:
mongodb:
condition: service_healthy
networks:
- task-manager-network
volumes:
- ./server:/app
- /app/node_modules
command: npm run dev
# Frontend Client (Development)
client:
build:
context: ./client
dockerfile: Dockerfile.dev
container_name: task-manager-client
restart: unless-stopped
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:5000/api
VITE_SOCKET_URL: http://localhost:5000
depends_on:
- server
networks:
- task-manager-network
volumes:
- ./client:/app
- /app/node_modules
command: npm run dev
volumes:
mongodb_data:
driver: local
mongodb_config:
driver: local
networks:
task-manager-network:
driver: bridge