Unverified Commit ad314ac8 authored by Tom Moulard's avatar Tom Moulard Committed by GitHub
Browse files

watchtower: add mechanism to update lastes images vrsion of running containers (#21)

parent 8380f567
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -47,3 +47,7 @@ VPN_IMAGE_VERSION=
VPN_IPSEC_PSK=
VPN_PASSWORD=
VPN_USER=
WATCHTOWER_CLEANUP=
WATCHTOWER_IMAGE_VERSION=
WATCHTOWER_ROLLING_RESTART=
WATCHTOWER_SCHEDULE=
+11 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,17 @@ services:
    restart: always
    volumes:
    - /lib/modules:/lib/modules:ro
  watchtower:
    environment:
      WATCHTOWER_CLEANUP: "true"
      WATCHTOWER_ROLLING_RESTART: "true"
      WATCHTOWER_SCHEDULE: '''0 0 2 * * *'''
    image: containrrr/watchtower:latest
    labels:
      traefik.enable: "False"
    restart: always
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:rw
  wordpress:
    depends_on:
      wordpress-db:

watchtower/README.md

0 → 100644
+11 −0
Original line number Diff line number Diff line
# Watchtower

https://containrrr.dev/watchtower/

A container-based solution for automating Docker container base image updates.

With watchtower you can update the running version of your containerized app
simply by pushing a new image to the Docker Hub or your own image registry.
Watchtower will pull down your new image, gracefully shut down your existing
container and restart it with the same options that were used when it was
deployed initially.
+14 −0
Original line number Diff line number Diff line
version: '2'

services:
  watchtower:
    image: containrrr/watchtower:${WATCHTOWER_IMAGE_VERSION:-latest}
    environment:
      WATCHTOWER_CLEANUP: ${WATCHTOWER_CLEANUP:-true}
      WATCHTOWER_ROLLING_RESTART: ${WATCHTOWER_ROLLING_RESTART:-true}
      WATCHTOWER_SCHEDULE: ${WATCHTOWER_SCHEDULE:-'0 0 2 * * *'} # run at 2am everyday
    restart: always
    labels:
      traefik.enable: false
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'