forked from AtulKumar2004/Foodie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (75 loc) · 1.68 KB
/
docker-compose.yml
File metadata and controls
81 lines (75 loc) · 1.68 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-alpine
container_name: foodie-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password123
MONGO_INITDB_DATABASE: foodie
volumes:
- mongodb_data:/data/db
networks:
- foodie-network
# Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: foodie-backend
restart: unless-stopped
ports:
- "4000:4000"
environment:
- NODE_ENV=production
- MONGODB_URI=mongodb://admin:password123@mongodb:27017/foodie?authSource=admin
- JWT_SECRET=your-jwt-secret-key
- PORT=4000
volumes:
- ./backend/uploads:/app/uploads
depends_on:
- mongodb
networks:
- foodie-network
# Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: foodie-frontend
restart: unless-stopped
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:4000
depends_on:
- backend
networks:
- foodie-network
# Admin Panel Service
admin:
build:
context: ./admin
dockerfile: Dockerfile
container_name: foodie-admin
restart: unless-stopped
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:4000
depends_on:
- backend
networks:
- foodie-network
# Named volumes for data persistence
volumes:
mongodb_data:
driver: local
# Custom network for service communication
networks:
foodie-network:
driver: bridge