Skip to content

Conversation

@martyngigg
Copy link
Member

Merge #54 first.

Minor changes to allow mounting the source code directly into the container to allow editing of the Python code while the containers are running.

Testing

I have updated DevelopmentSetup.md docs. Try to follow the instructions and create the override file then run the services.

To test if editing it works:

  • ensure the services are running using the bin/boot.sh script
  • make a change to one of the unit tests, for example force one to fail
  • without stopping the services run docker-compose exec web sh -c "python manage.py test" to check the change has been reflected

Setting the slack hook to an empty string is the easiest
way to disable to hook for testing.
The old script stomped on .env files and did no cleanup.
The new script uses and existing .env/DB if it exists and
generates one a .env file if not. If a .env file and DB did
not exist then they are cleaned at the end.

Services are also only booted if they are not already running.
Arguments are passed directly to python manage.py test command
Set a default DEBUG value to avoid compose warning
A volume is used for this now.
The postgres container chowns the bind mounted directory
and this can then require sudo to remove on the host.
Users will need to remove pgdata by hand if they want to.
This works in the case that we don't own the DB directory.
These are the only files that need sharing with the
nginx container. This will allow is to mount the code
inside container and edit in while the services are
running without having to shutdown and rebuild the
web image.
@jhaigh0 jhaigh0 self-assigned this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants