-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (20 loc) · 787 Bytes
/
Copy pathMakefile
File metadata and controls
25 lines (20 loc) · 787 Bytes
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
ORG_ID = dcn
DOCKER_IMAGE = python36-django-env
DOCKER_NETWORK = nave_nave_network
COMMON_RUN_FLAGS = --network=$(DOCKER_NETWORK) \
-v "$(PWD)":/app \
-w /app \
-e DJANGO_SETTINGS_MODULE=nave.projects.$(ORG_ID).settings \
-e DATABASE_HOST="postgresql" \
-e DATABASE_PORT="5432"
# Build Docker image
build-docker:
docker build -t $(DOCKER_IMAGE) .
# Run Django server
runserver:
docker run -it --rm $(COMMON_RUN_FLAGS) -p 8000:8000 $(DOCKER_IMAGE) python manage.py runserver 0.0.0.0:8000
# Open Django shell
shell:
docker run -it --rm $(COMMON_RUN_FLAGS) $(DOCKER_IMAGE) python manage.py shell
migrate:
docker run -it --rm $(COMMON_RUN_FLAGS) $(DOCKER_IMAGE) python manage.py migrate