Just messing around with watchtower and an 'application' image with traefik.
We only care about three things here, other services are illustration purposes only:
- http://app.poc.ac93.uk - simple app that we will CD
- http://watchtower.poc.ac93.uk - we will send a webhook when our docker image is built to re-deploy it
- local.registry.ac93.uk:5000 - pushing the above app image
sudo tee -a /etc/hosts > /dev/null <<EOF
127.0.0.1 local.registry.ac93.uk
127.0.0.1 watchtower.poc.ac93.uk
127.0.0.1 traefik.poc.ac93.uk
127.0.0.1 app.poc.ac93.uk
127.0.0.1 ip.pox.ac93.uk
EOF
watchtower
can't monitor local images so we need to push them to a registry.
Starting the registry:
make registry
You will need to update watchtower-config.json
as discussed here to deal with private registries.
Just a caddy SPA app:
make image
Push to registry:
make push
Check interpolation if you want to change stuff (shouldn't need to):
docker-compose config
docker-compose up
xdg-open 'http://app.poc.ac93.uk'
Go to http://app.poc.ac93.uk
xdg-open 'http://app.poc.ac93.uk'
Make a change to html/index.html
and re-build image, wait a minute (poll interview of watchtower) and refresh
make image
make push