add make targets for some manage.py tasks
This commit is contained in:
parent
0fdf7029e4
commit
2e3be76e31
|
|
@ -18,6 +18,9 @@ RUN apk add --virtual build-deps gcc python3-dev musl-dev && \
|
|||
|
||||
COPY . .
|
||||
|
||||
# Create symlink to manage.py script in PATH
|
||||
RUN ln -s /usr/src/app/manage.py /usr/local/bin/manage.py
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "pluralityspace.wsgi:application", \
|
||||
|
|
|
|||
15
Makefile
15
Makefile
|
|
@ -9,8 +9,9 @@ SERVER_LISTEN ?= 0.0.0.0:8042
|
|||
STAGE ?= production
|
||||
GIT_CRYPT_KEY ?= ~/.git-crypt-keys/$(APP_NAME)-$(STAGE).key
|
||||
DOCKER_COMPOSE_YML := .deployment/$(STAGE)/docker-compose.yml
|
||||
APP_CONTAINER_NAME := django
|
||||
|
||||
.PHONY: run docker-build docker-run decrypt deploy log-show
|
||||
.PHONY: run docker-build docker-run decrypt deploy log-show live-collectstatic live-migrate live-shell
|
||||
|
||||
# Default target: none
|
||||
all:
|
||||
|
|
@ -44,3 +45,15 @@ deploy:
|
|||
# Show logs for running container
|
||||
log-show:
|
||||
docker-compose -f $(DOCKER_COMPOSE_YML) logs -f
|
||||
|
||||
# Run django 'collectstatic' command on live container
|
||||
live-collectstatic:
|
||||
docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} manage.py collectstatic --no-input --clear
|
||||
|
||||
# Run django 'migrate' command on live container
|
||||
live-migrate:
|
||||
docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} manage.py migrate --no-input
|
||||
|
||||
# Run shell in live container
|
||||
live-shell:
|
||||
docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} sh
|
||||
|
|
|
|||
Loading…
Reference in New Issue