Code Monkey home page Code Monkey logo

docker-autostart's Introduction

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}'

docker-autostart's People

Contributors

agp8x avatar

Stargazers

Michael Götz avatar Michael Träger avatar

Watchers

James Cloos avatar  avatar Michael Träger avatar

Forkers

michigg agp8x

docker-autostart's Issues

Via Configuration File Customizable Key Prefix

Currently the .json configuration file do not provide options to configure a custom label prefix for the auto discovery.
I would prefer to configure the auto discovery via the json file instead of saving the command with all its options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.