mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-10 11:54:15 +03:00
Add justfile for use with docker
This commit is contained in:
parent
3ef84f1a26
commit
924e421ec9
|
@ -82,6 +82,7 @@ def remove_docker_files():
|
|||
"docker-compose.local.yml",
|
||||
"docker-compose.production.yml",
|
||||
".dockerignore",
|
||||
"justfile",
|
||||
]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
|
|
33
{{cookiecutter.project_slug}}/justfile
Normal file
33
{{cookiecutter.project_slug}}/justfile
Normal file
|
@ -0,0 +1,33 @@
|
|||
export COMPOSE_FILE := "docker-compose.local.yml"
|
||||
|
||||
# Default command to list all available commands.
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# build: Build python image.
|
||||
build:
|
||||
@echo "Building python image..."
|
||||
@docker-compose build
|
||||
|
||||
# up: Start up containers.
|
||||
up:
|
||||
@echo "Starting up containers..."
|
||||
@docker-compose up -d --remove-orphans
|
||||
|
||||
# down: Stop containers.
|
||||
down:
|
||||
@echo "Stopping containers..."
|
||||
@docker-compose down
|
||||
|
||||
# prune: Remove containers and their volumes.
|
||||
prune *args:
|
||||
@echo "Killing containers and removing volumes..."
|
||||
@docker-compose down -v {{ "{{args}}" }}
|
||||
|
||||
# logs: View container logs
|
||||
logs *args:
|
||||
@docker-compose logs -f {{ "{{args}}" }}
|
||||
|
||||
# manage: Executes `manage.py` command.
|
||||
manage +args:
|
||||
@docker-compose run --rm django python ./manage.py {{ "{{args}}" }}
|
Loading…
Reference in New Issue
Block a user