-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (62 loc) · 1.37 KB
/
Copy pathdocker-compose.yml
File metadata and controls
68 lines (62 loc) · 1.37 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
# WARNING: Copy .env.example to .env and update with your actual values before running.
# DO NOT use default/example values in production!
services:
# MongoDB Database
mongodb:
image: mongo:7
container_name: bitwebapp-mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
- MONGO_INITDB_DATABASE=bitwebapp
networks:
- bitwebapp-network
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 5s
retries: 5
# Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: bitwebapp-backend
ports:
- "3000:3000"
env_file:
- .env.docker
depends_on:
mongodb:
condition: service_healthy
networks:
- bitwebapp-network
volumes:
- ./backend:/app
- /app/node_modules
command: npm run dev
# Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: bitwebapp-frontend
ports:
- "5173:5173"
env_file:
- .env.docker
depends_on:
- backend
networks:
- bitwebapp-network
volumes:
- ./frontend:/app
- /app/node_modules
command: npm run dev -- --host 0.0.0.0
volumes:
mongodb_data:
networks:
bitwebapp-network:
driver: bridge