Go to file
Clemens Klug d100f5e255 add openrc skript 2019-04-25 14:39:45 +02:00
sample add pre/post exec hooks 2019-04-10 10:37:39 +02:00
Readme.md fix readme, use arguments in discover, too 2019-04-10 10:41:46 +02:00
discover.py fix readme, use arguments in discover, too 2019-04-10 10:41:46 +02:00
docker-autostart.openrc add openrc skript 2019-04-25 14:39:45 +02:00
start.py add pre/post exec hooks 2019-04-10 10:37:39 +02:00
start.sh add bash script (raw only) 2019-04-04 15:17:55 +02:00

Readme.md

Usage

autodiscover

usage: python3 discover.py [-a <action>] [-l] service_dir [service_dir …]

add label "de.wie-ei.autostart=true" to any service in a docker-compose-file

!! This label is discovered as string, not by parsing Yaml. Commenting will not work!

Examples:

  • start services (up -d) python3 discover.py /srv/services/ /opt/docker/testing/
  • which services are configured for autostart? python3 discover.py -l /srv/services/ /opt/docker/testing/
  • check status python3 discover.py -a ps /opt/docker/testing/
  • stop services python3 discover.py -a "down -v /srv/testing/

pre/post exec

e.g. python3 discover.py ./sample/ -a ps --pre 'echo {path} {step}' --post './sample/notify_telegram.sh <telegram_bot_key> <telegram_room> {path} {cmd} {returncode} \n {stdout}'

manual config

json config

  • create config.json from sample.json
  • add python3 /opt/docker-autostart/start.py /path/to/your/config.json -t json to /etc/rc.local

raw config

  • create config.lst from sample.lst
  • add python3 /opt/docker-autostart/start.py /path/to/your/config.lst to /etc/rc.local

other actions

  • default action: up -d
  • add argument -a ""

pre/post exec

e.g. python3 start.py test.lst -a ps --pre 'echo {path} {step}' --post './sample/notify_telegram.sh <telegram_bot_key> <telegram_room> {path} {cmd} {returncode} \n {stdout}'