Add watchtower to manage auto-update of containers

This commit is contained in:
Jesper Hess 2019-03-03 15:26:39 +01:00
parent 0c1e94323c
commit 9ff11808ce
Signed by untrusted user: graffen
GPG key ID: 351A89E40D763F0F
3 changed files with 17 additions and 0 deletions

View file

@ -23,6 +23,7 @@
- docker_registry - docker_registry
- drone - drone
- websites - websites
- watchtower
smtp_host: postfix smtp_host: postfix
smtp_port: 587 smtp_port: 587

View file

@ -0,0 +1,12 @@
---
- name: watchtower container
docker_container:
name: watchtower
image: v2tec/watchtower
restart_policy: unless-stopped
networks:
- name: external_services
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/.docker/config.json:/config.json
command: ["--label-enable"]

View file

@ -11,6 +11,8 @@
VIRTUAL_HOST : "{{ data_coop_website.domain }}" VIRTUAL_HOST : "{{ data_coop_website.domain }}"
LETSENCRYPT_HOST: "{{ data_coop_website.domain }}" LETSENCRYPT_HOST: "{{ data_coop_website.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}" LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
labels:
com.centurylinklabs.watchtower.enable: "true"
- name: setup cryptohagen.dk website docker container - name: setup cryptohagen.dk website docker container
docker_container: docker_container:
@ -23,3 +25,5 @@
VIRTUAL_HOST : "{{ cryptohagen_website.domain }}" VIRTUAL_HOST : "{{ cryptohagen_website.domain }}"
LETSENCRYPT_HOST: "{{ cryptohagen_website.domain }}" LETSENCRYPT_HOST: "{{ cryptohagen_website.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}" LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
labels:
com.centurylinklabs.watchtower.enable: "true"