diff options
author | Yulqen <246857+yulqen@users.noreply.github.com> | 2024-05-23 15:35:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 15:35:49 +0100 |
commit | c89d53a2921e4e6b681c6a9dc97f7cc8eeb43956 (patch) | |
tree | 345d5259906a72a145095a6e465689d8d8a513d0 /Makefile | |
parent | 88dacb9f57a40c96f48c359275fe11f85aa1f051 (diff) | |
parent | 5f9ca9b3e597a9dfda9ffb3af25a60b2c7309986 (diff) |
Merge pull request #50 from defencedigital/postgres-migration
Postgres migration
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -1,12 +1,26 @@ +all: stop create-network build-postgres run-postgres build-django run-django + +CONFIG := conf.settings.local + runserver: python manage.py runserver 0.0.0.0:8000 -runserver-docker: - docker run -it --name ded -d --rm -p 8000:8000 ded:latest +create-network: + -docker network create dednetwork +stop: + -docker stop ded-web postgres runserver-docker-with-vol: docker run -it --name ded -d --rm -p 8000:8000 -v $(PWD):/app ded:latest sync: git pull && git checkout main && git pull && git merge pyswitch && git checkout pyswitch && git rebase main && git push -build: - docker build -t ded:latest . +build-django: + docker build -f Dockerfile -t ded-web:latest . +build-postgres: + docker build -t dso-quay-registry-quay-quay-enterprise.apps.ocp1.azure.dso.digital.mod.uk/defnucsyr-dev-team-a/postgresql:v1.0.0 . -f Dockerfile_postgresql +run-postgres: + docker run -it --name postgres -d --rm -e POSTGRESQL_PASSWORD=ded -e POSTGRESQL_USER=ded -e POSTGRESQL_DATABASE=ded -p 5432:5432 --network dednetwork dso-quay-registry-quay-quay-enterprise.apps.ocp1.azure.dso.digital.mod.uk/defnucsyr-dev-team-a/postgresql:v1.0.0 +run-django: + docker run -d -it --name ded-web -e DJANGO_SETTINGS_MODULE=$(CONFIG) -p 8000:8000 --network dednetwork --rm ded-web:latest test: python manage.py test +migrate-and-superuser: + docker exec -it ded-web sh -c "python manage.py migrate && python manage.py createsuperuser" |