-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (60 loc) · 1.25 KB
/
docker-compose.yml
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
version: '3.8'
services:
api:
build:
context: ./server
container_name: backend
restart: always
environment:
NODE_ENV: development
MONGO_URI: mongodb://root:example@mongodb:27017/
ACCESS_TOKEN_SECRET: secret123
REFRESH_TOKEN_SECRET: secret123
ports:
- 4000:4000
depends_on:
- mongodb
networks:
- react-express
- express-mongo
volumes:
- ./server:/usr/src/app
- /usr/src/app/node_modules
web:
build:
context: ./client
target: build
container_name: frontend
environment:
VITE_NODE_ENV: development
VITE_SERVER_URL: http://localhost:4000
ports:
- 5173:5173
networks:
- react-express
stdin_open: true
restart: always
depends_on:
- api
command: bun dev
volumes:
- ./client:/usr/src/app
- /usr/src/app/node_modules
mongodb:
image: mongo:latest
restart: always
container_name: mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=example
ports:
- '27017:27017'
networks:
- express-mongo
volumes:
- ./server/mongo_data:/data/db
networks:
react-express:
express-mongo:
volumes:
mongo_data: