-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.33 KB
/
Makefile
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
.PHONY: docker-build run-in-docker createsuperuser
DOCKER_BUILD_CONTEXT='./'
DOCKER_NAME='lagreeneceramics'
DOCKER_TAG='alpha'
docker-build:
docker build \
-f $(DOCKER_BUILD_CONTEXT)/Dockerfile \
--build-arg SECRET_KEY='${SECRET_KEY}' \
--build-arg DATABASE_NAME='${DATABASE_NAME}' \
--build-arg DATABASE_USER='${DATABASE_USER}' \
--build-arg DATABASE_URL='${DATABASE_URL}' \
--build-arg DATABASE_PASSWORD='${DATABASE_PASSWORD}' \
--build-arg DATABASE_HOST='${DATABASE_HOST}' \
--build-arg DATABASE_PORT='${DATABASE_PORT}' \
--build-arg DJANGO_DEBUG='${DJANGO_DEBUG}' \
-t $(DOCKER_NAME):$(DOCKER_TAG) \
$(DOCKER_BUILD_CONTEXT)
run-in-docker:
docker run --rm \
-p 8000:8000 \
--name $(DOCKER_NAME) \
$(DOCKER_NAME):$(DOCKER_TAG)
docker-clean:
docker rm -f $(DOCKER_NAME) || true
docker image rm $(DOCKER_NAME):$(DOCKER_TAG) || true
create-super-user:
docker exec -it $(DOCKER_NAME) python manage.py createsuperuser
.PHONY: deps migrations migrate collectstatic dev
deps:
poetry install
migrations:
poetry run python app/manage.py makemigrations
migrate:
poetry run python app/manage.py migrate
collectstatic:
poetry run python app/manage.py collectstatic
dev:
poetry run python app/manage.py runserver
create-requirements-file:
poetry export --format requirements.txt --without-hashes -o requirements.txt