alistaircol / traefik-watchtower-app-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Just messing around with watchtower and an 'application' image with traefik.

setting up

We only care about three things here, other services are illustration purposes only:

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

running a private local registry

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.

build initial image

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

starting

docker-compose up
xdg-open 'http://app.poc.ac93.uk'

testing

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

screenshot

About


Languages

Language:Makefile 86.1%Language:Shell 5.1%Language:Dockerfile 5.1%Language:HTML 3.7%