forked from HVish/smart-education
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (51 loc) · 1.05 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
version: '3.1'
services:
db:
image: mongo:7
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: $DB_NAME
DB_NAME: $DB_NAME
DB_USER: $DB_USER
DB_PASS: $DB_PASS
volumes:
- db-data:/data/db
- ./db/init.sh:/docker-entrypoint-initdb.d/init.sh
ports:
- "27017:27017"
server:
build:
context: ./server
dockerfile: Dockerfile
depends_on:
- db
env_file:
- .env
volumes:
- ./server/src:/app/src
# ports:
# - "4000:4000"
web:
build:
context: ./web
dockerfile: Dockerfile
command: [ "npm", "run", "dev", "--", "--host" ]
volumes:
- ./web/src:/app/src
- ./web/public:/app/public
# ports:
# - "3001:3000"
nginx:
image: nginx:alpine
command: [ "nginx", "-g", "daemon off;" ]
depends_on:
- server
- web
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- "3000:80"
volumes:
db-data: