Giter Club home page Giter Club logo

runit-conf's Introduction

runit-conf

A Supervisor inspired configurator for runit. Useful for automation and control of multiple applications inside a Docker container.

Installation

Inside a Dockerfile:

ENV RC_TGZ runit-conf-linux-<ARCH>.tgz
ENV RC_VER v#.#.#
RUN wget -q https://github.com/jarrodsinclair/runit-conf/releases/download/${RC_VER}/${RC_TGZ} && \
    tar -xzf ${RC_TGZ} --strip-components=1 -C /usr/local/bin/ && \
    rm -rf ${RC_TGZ}

Usage

Once runit-conf has been installed, call the bootstrap script with a configuration file as the first (and only) command at the end of the Dockerfile:

CMD ["runit-bootstrap", "runit-conf.toml"]

Configuration

A TOML formatted file is used for configuring the runit services and startup commands, similar to a Supervisor YAML file. First, provide a target path to write all of the runit scripts. A list of services is defined with boot and foreground (run) commands as Linux shell calls. Each service can optionally be tied to an environment variable that will activate when the value is 1, else will not run. If the conditional field is not present in the service description, the service will always run.

Sample configuration file:

[runit]
directory = "/usr/src/runit"

[[service]]
name = "my_optional_service_1"
conditional = "MY_SERVICE_1"
directory = "my_dir_1"
boot = """
command_at_boot_1.1
command_at_boot_1.2
"""
run = "command_persistent"

[[service]]
name = "my_optional_service_2"
conditional = "MY_SERVICE_2"
boot = "command_at_boot_2"
run = "command_persistent_2"

[[service]]
name = "always_run"
run = "foreground_service"

runit-conf's People

Contributors

jarrodsinclair avatar

Watchers

James Cloos avatar

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.