diff --git a/docker-compose.yml b/docker-compose.yml index ce5769b..1090668 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: entrypoint: ["./test_project/wait-for-postgres.sh"] ports: - "${APP_PORT:-8000}:${APP_PORT:-8000}" - command: python test_project/manage.py runserver 0.0.0.0:${APP_PORT:-8000} + command: bash -c "python test_project/manage.py migrate && python test_project/manage.py runserver 0.0.0.0:${APP_PORT:-8000}" docs: build: . volumes: diff --git a/docs/contributing.md b/docs/contributing.md index 42f8e29..5ea721b 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -79,20 +79,19 @@ At this point, you'll be in a bash shell inside your container, and can run deve The Docker Compose setup is configured to run a simple test project that you can use to tinker with the dashboard interactively. -To set this up, first run: +To use it, run: ``` -docker-compose run app python test_project/manage.py migrate -docker-compose run app python test_project/manage.py createsuperuser +docker-compose up ``` -You will now be prompted to enter details about a new superuser. Once you've done that, run: +Then, in a separate terminal, run: ``` -docker-compose up +docker-compose run app python test_project/manage.py createsuperuser ``` -You can now visit the example app's dashboard at http://localhost:8000/. +You will now be prompted to enter details about a new superuser. Once you've done that, you can visit the example app's dashboard at http://localhost:8000/. After entering the credentials for the superuser you just created, you will be able to tinker with the dashboard. ### Editing the documentation @@ -129,11 +128,7 @@ The project's Python dependencies are all baked into the container image, which docker-compose build ``` -You may also want to apply any new migrations that were added to the codebase: - -``` -docker-compose run app python test_project/manage.py migrate -``` +You will also want to restart `docker-compose up`. ### Cleaning up