Use docker compose for debugging production #158
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Branched from #156.
Rationale
While working on #156, I needed a setup a bit closer to production. Specifically I needed a setup that used Postgres and I wanted to use django-storages to store media files instead of the local filesystem.
Testing
With docker and docker-compose installed, you should be able to run
Without setting anything, it will store media in a local media directory that will disappear when you close down the server. The plan is to use cloud storage in production. I plan to use R2 and stay well under the free tier. I tested this out and it seemed to work well.
You still should be able to run the default
./manage.py runserver
if you prefer.Deploying
The environment variables needed for this change are already staged in fly.io. Since there's no code that uses them yet, they're not doing anything. However, if this is merged into prod, the envvars will take effect and media storage should hopefully just work.