Move container logic from `docker-compose.yml` to `Dockerfile`
dadatuputi opened this issue · 4 comments
Much of the command
mess in the compose file should be in their own Dockerfile
s that extends the base image. Easily done with caddy as of 837c1fc, however watchtower won't pull updates to the base image (see containrrr/watchtower#1401).
Alternatives to watchtower, cron?
- It would require a simple script and an extra step during installation.
- Existing users who blindly
git pull
will miss that step
- Migrate the different images to their own repo, use CI to publish them to docker repo when base images updates (see https://www.flypenguin.de/2021/07/30/auto-rebuild-docker-images-if-base-image-changes-using-github-actions/)
This seems like the most sensible approach, although clunky, until watchtower or some other process is capable of rebuilding images when base images are updated.
Giving the CI -> docker repository (ghcr) a try with caddy (#57). Used https://www.howtogeek.com/devops/how-to-set-up-automatic-builds-for-docker-images-on-github/ and https://www.flypenguin.de/2021/07/30/auto-rebuild-docker-images-if-base-image-changes-using-github-actions/ to throw something together in Github actions.
#58 is merged, now just need to split countryblock into its own project.
Moved 3 containers to their own project/repo:
Each has Github actions in place that will
- Build and publish the docker image on each push or merged pull request
- Check the base image daily for a new version, and rebuild and publish when there is a new base image version
This should keep these containers up to date, and with watchtower running, keep everything perpetually updated.