-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for docker-compose. #221
base: main
Are you sure you want to change the base?
Conversation
…ntainer with volumes to make the database persistent, and for developers to make changes to the editor guide code and test them out on the running container.
… the frontend container to be able to run npm commands
@@ -0,0 +1,98 @@ | |||
# (Keep the version in sync with the node install below) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: What's the value in having a separate dockerfile? The main one ought to work just fine for this.
|
||
docker-init: | ||
docker exec -it guide_latest /bin/bash -c "make backend" | ||
docker-compose exec web poetry install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why are dependencies being run like this? It happens during build time, which is probably fine.
docker-compose exec web poetry install |
dockerfile: Dockerfile.localdev | ||
extra_hosts: | ||
- 'host.docker.internal:host-gateway' | ||
command: poetry run python manage.py runserver 0.0.0.0:${PORT:-8000} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: If we always override the command here, why not just put it in the dockerfile?
ports: | ||
- '${PORT:-8000}:${PORT:-8000}' | ||
environment: | ||
SECRET_KEY: $SECRET_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we duplicating these to pass them through? I'd recommend either using dummy values, or having docker-compose
read from a .env
file.
An iteration on some Makefile commands I added earlier. I realised that it was too hard to manage the container using only docker, it's much nicer to use docker-compose. This makes it easier to manage the container with volumes to make the database persistent, and for developers to make changes to the editor guide code and test them out on the running container.
I did have to make my own version of the Dockerfile but only because I couldn't override the
POETRY_INSTALL_ARGS
setting in the Dockerfile.