-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (55 loc) · 1.25 KB
/
docker-compose.yml
File metadata and controls
58 lines (55 loc) · 1.25 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
services:
# MongoDB database
mongodb:
image: mongo:latest
container_name: trackbite-mongo
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: trackbite
volumes:
- mongo_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: trackbite-backend
ports:
- "3000:3000"
- "3001:3001"
environment:
NODE_ENV: development
MONGO_URI: mongodb://root:password@mongodb:27017/trackbite?authSource=admin
PORT: 3000
depends_on:
mongodb:
condition: service_healthy
volumes:
- ./backend/src:/app/src
restart: unless-stopped
# Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: trackbite-frontend
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:3000
depends_on:
- backend
volumes:
- ./frontend/src:/app/src
restart: unless-stopped
volumes:
mongo_data:
driver: local