Added building from git repos. Added launch script with secrets retrieval.
This commit is contained in:
parent
c955d5deca
commit
83b8bfc58a
@ -3,7 +3,8 @@ version: "2.1"
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
mysql-server:
|
mysql-server:
|
||||||
image: mysql-server
|
image: mysql-server:$VERSION_MYSQL
|
||||||
|
build: "https://git.scimetis.net/yohan/docker-mysql.git"
|
||||||
container_name: mysql-server
|
container_name: mysql-server
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -12,9 +13,11 @@ services:
|
|||||||
- mysql-server_data:/var/lib/mysql:Z
|
- mysql-server_data:/var/lib/mysql:Z
|
||||||
- mysql-server_dumps:/mnt/dumps:Z
|
- mysql-server_dumps:/mnt/dumps:Z
|
||||||
- ./nettoyer_quotas.sh:/root/nettoyer_quotas.sh:Z
|
- ./nettoyer_quotas.sh:/root/nettoyer_quotas.sh:Z
|
||||||
|
- ./debian.cnf:/etc/mysql/debian.cnf:Z
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
image: cron
|
image: cron:$VERSION_CRON
|
||||||
|
build: "https://git.scimetis.net/yohan/docker-cron.git"
|
||||||
restart: always
|
restart: always
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
volumes:
|
volumes:
|
||||||
|
10
start_or_update.sh
Executable file
10
start_or_update.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
test -f ~/secrets.tar.gz.enc || curl -o ~/secrets.tar.gz.enc https://cloud.scimetis.net/s/$KEY/download
|
||||||
|
openssl enc -aes-256-cbc -d -in ~/secrets.tar.gz.enc | tar -zxv --strip 2 secrets/docker-mysql-stack/crontab secrets/docker-mysql-stack/debian.cnf
|
||||||
|
sudo chown root. crontab debian.cnf
|
||||||
|
# --force-recreate is used to recreate container when crontab file has changed
|
||||||
|
unset VERSION_MYSQL VERSION_CRON
|
||||||
|
VERSION_MYSQL=$(git ls-remote ssh://git@git.scimetis.net:2222/yohan/docker-mysql.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'
|
||||||
|
rm -f crontab debian.cnf
|
Loading…
Reference in New Issue
Block a user