-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (64 loc) · 1.75 KB
/
docker-compose.yml
File metadata and controls
68 lines (64 loc) · 1.75 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
version: '3.8'
services:
# Frontend & Backend - Node.js Express App
app:
build:
context: .
dockerfile: Dockerfile
container_name: apnaworker-app
ports:
- "5000:5000"
environment:
- NODE_ENV=production
- PORT=5000
- MONGODB_URI=mongodb://mongo:27017/apnaworker
- CLIENT_URL=http://localhost:5000
- JWT_SECRET=${JWT_SECRET:-your-secret-key-change-in-production}
- CLOUDINARY_CLOUD_NAME=${CLOUDINARY_CLOUD_NAME}
- CLOUDINARY_API_KEY=${CLOUDINARY_API_KEY}
- CLOUDINARY_API_SECRET=${CLOUDINARY_API_SECRET}
- RAZORPAY_KEY_ID=${RAZORPAY_KEY_ID}
- RAZORPAY_KEY_SECRET=${RAZORPAY_KEY_SECRET}
depends_on:
- mongo
networks:
- apnaworker-network
restart: unless-stopped
volumes:
- ./backend/node_modules:/app/backend/node_modules
- ./backend:/app/backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MongoDB Database
mongo:
image: mongo:7.0-alpine
container_name: apnaworker-mongo
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER:-admin}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD:-password123}
- MONGO_INITDB_DATABASE=apnaworker
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
- mongo_config:/data/configdb
networks:
- apnaworker-network
restart: unless-stopped
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
volumes:
mongo_data:
driver: local
mongo_config:
driver: local
networks:
apnaworker-network:
driver: bridge