-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
56 lines (49 loc) · 985 Bytes
/
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'
volumes:
init-db:
data-db:
services:
mongodb:
image: mongo
restart: always
volumes:
- ./init-db:/docker-entrypoint-initdb.d
- ./data-db:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: mongoadmin
MONGO_INITDB_DATABASE: student
ports:
- 27017:27017
web:
image: app
restart: always
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/django_mongodb_docker
ports:
- 8000:8000
links:
- mongodb
depends_on:
- migration
migration:
build: .
image: app
command: python manage.py migrate
volumes:
- .:/django_mongodb_docker
links:
- mongodb
depends_on:
- make_migrations
make_migrations:
build: .
image: app
command: python manage.py makemigrations
volumes:
- .:/django_mongodb_docker
links:
- mongodb
depends_on:
- mongodb