-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
149 lines (142 loc) · 3.43 KB
/
Copy pathdocker-compose.yml
File metadata and controls
149 lines (142 loc) · 3.43 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
services:
# MongoDB Database
mongodb:
image: mongo:latest
container_name: citybites-mongodb
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: group_48
MONGO_INITDB_ROOT_PASSWORD: 291381
MONGO_INITDB_DATABASE: citybites
volumes:
- mongodb_data:/data/db
networks:
- citybites-network
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost/test --quiet
interval: 10s
timeout: 5s
retries: 5
# Backend API Server
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: citybites-backend
restart: always
ports:
- "4000:4000"
environment:
NODE_ENV: development
PORT: 4000
MONGODB_URI: mongodb://root:password123@mongodb:27017/citybites?authSource=admin
JWT_SECRET: your_jwt_secret_key_change_this
STRIPE_API_KEY: ${STRIPE_API_KEY:-sk_test_dummy}
EMAIL_SERVICE: gmail
EMAIL_USER: amandawijesinghe2001@gmail.com
EMAIL_PASS: gwqw aouz pzgw tcaj
EMAIL_FROM: noreply@citybites.com
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./backend:/app
- /app/node_modules
- backend_uploads:/app/uploads
networks:
- citybites-network
healthcheck:
test: curl -f http://localhost:4000/ || exit 1
interval: 30s
timeout: 10s
retries: 3
# Chat Server (Socket.io)
chat-server:
build:
context: ./chat/server
dockerfile: Dockerfile
container_name: citybites-chat-server
restart: always
ports:
- "5001:5001"
environment:
NODE_ENV: development
PORT: 5001
MONGODB_URI: mongodb+srv://group_48:291381@cluster0.ixyx7h7.mongodb.net/ChatApp
JWT_SECRET: your_jwt_secret_key_change_this
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./chat/server:/app
- /app/node_modules
networks:
- citybites-network
healthcheck:
test: curl -f http://localhost:5001/api/status || exit 1
interval: 30s
timeout: 10s
retries: 3
# Admin Panel (React/Vite)
admin:
build:
context: ./admin
dockerfile: Dockerfile
container_name: citybites-admin
restart: always
ports:
- "5173:5173"
environment:
VITE_BACKEND_URL: http://localhost:4000
depends_on:
- backend
volumes:
- ./admin:/app
- /app/node_modules
networks:
- citybites-network
# Frontend (React/Vite) - Customer App
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: citybites-frontend
restart: always
ports:
- "5174:5174"
environment:
VITE_BACKEND_URL: http://localhost:4000
VITE_CHAT_URL: http://localhost:5172
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
networks:
- citybites-network
# Chat Client (React/Vite)
chat-client:
build:
context: ./chat/client
dockerfile: Dockerfile
container_name: citybites-chat-client
restart: always
ports:
- "5172:5172"
environment:
VITE_BACKEND_URL: http://localhost:5001
depends_on:
- chat-server
volumes:
- ./chat/client:/app
- /app/node_modules
networks:
- citybites-network
volumes:
mongodb_data:
backend_uploads:
networks:
citybites-network:
driver: bridge