diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-28 15:15:44 +0100 |
commit | 2037c6b87564772c7ac3f3ece3e4b2df5bc44cdc (patch) | |
tree | 222bb552655033468af47818a072096999cd03d9 /Makefile | |
parent | 2b4181aecadbbad988cd80f97ef71b42d47a3cb1 (diff) |
Should be a buildable Django container
Diffstat (limited to '')
-rw-r--r-- | Makefile | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4744c12 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +all: build run migrate collectstatic + +start: build run migrate collectstatic + +build: + @docker build -f compose/production/django/Dockerfile -t pyblackbird_cc:latest . + +push: + @docker build -f compose/production/django/Dockerfile -t pyblackbird_cc:latest . && docker tag pyblackbird_cc registry.digitalocean.com/twentyfour-registry/pyblackbird && docker push registry.digitalocean.com/twentyfour-registry/pyblackbird + +clean-registry: + @doctl registry garbage-collection start --include-untagged-manifests twentyfour-registry + +run: + @docker run -d --rm --name pyblackbird_cc_django --env-file .env -p 8080:8080 pyblackbird_cc + +collectstatic: + @docker run --rm --env-file .env -v .:/app pyblackbird sh -c "python manage.py collectstatic --noinput" + +migrate: + @docker run --rm --env-file .env -v .:/app pyblackbird sh -c "python manage.py makemigrations && python manage.py migrate" + +clean: + @docker stop pyblackbird + @sleep 2 + @docker rmi pyblackbird + +test-all: + @pytest -q -s . + +test: + @pytest -q -s -m "not slow" |