Added pulling cron image from git.

This commit is contained in:
yohan 2019-02-03 22:00:37 +01:00
parent fa4c498c8d
commit 9b7ed2f5e0
2 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,7 @@ version: "2.1"
services:
reverse-proxy:
image: reverse-proxy:$VERSION
image: reverse-proxy:$VERSION_PROXY
build: "https://git.scimetis.net/yohan/docker-reverse-proxy.git"
restart: always
ports:
@ -17,7 +17,8 @@ services:
- reverse-proxy_letsencrypt:/etc/letsencrypt:Z
cron:
image: cron
image: cron:$VERSION_CRON
build: "https://git.scimetis.net/yohan/docker-cron.git"
restart: always
network_mode: "host"
volumes:

View File

@ -1,5 +1,8 @@
#!/bin/bash
sudo chown root. crontab
# --force-recreate is used to recreate container when crontab file has changed
unset VERSION; VERSION=$(git ls-remote ssh://git@git.scimetis.net:2222/yohan/docker-reverse-proxy.git| head -1 | cut -f 1|cut -c -10) sudo -E bash -c 'docker-compose up -d --force-recreate'
unset VERSION_PROXY VERSION_CRON
VERSION_PROXY=$(git ls-remote ssh://git@git.scimetis.net:2222/yohan/docker-reverse-proxy.git| head -1 | cut -f 1|cut -c -10) \
VERSION_CRON=$(git ls-remote ssh://git@git.scimetis.net:2222/yohan/docker-cron.git| head -1 | cut -f 1|cut -c -10) \
sudo -E bash -c 'docker-compose up -d --force-recreate'