Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
73 stars 32 forks source link

Change docker config to fix errors & improve caching #346

Closed robjwells closed 3 years ago

robjwells commented 3 years ago

Most importantly, this PR updates the docker configuration to allow migration 27 to succeed (it could throw depending on cache configuration) and account for the change to the CLI structure in a6496f7771056ffb856a3fb5ac7de4d20765c77e.

Additionally, there's a small fix so that the database health check can succeed, and that Python cache (.pyc) files are not copied from the host into the built image.

It also ensures that the translations are compiled into .mo files and made available to both webpack and Flask.

The largest change is in the most-recent-but-one commit (8e50dd8), where the Dockerfile is changed to use multi-stage builds. This should reduce the need to reinstall the node modules and re-run webpack when other files in the project change. This is contained in that one commit so it can be excluded if anyone spots any problems without affecting the more straightforward changes.

The change in commit 0d70f97 is also consequential in that it stops mounting the entire repo directory at /throat, as this unfortunately masks everything in the container’s /throat — including, importantly, files that are created or changed as part of the Docker build process. This is why, for instance, it was necessary to create a manifest.json file locally (#287) before being able to bring up the containers. The compose file now only mounts app/html and app/templates into the container, so files in those directories can still be edited live.