Skip to content

Small init system with templated config files; to be used as container entrypoint

License

Notifications You must be signed in to change notification settings

dkorittki/mittnite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mittnite - Smart init system for containers

Mittnite is a small, but smart init system designed for usage as ENTRYPOINT in container images.

It offers the following features:

  • Render configuration files from templates using Go's text/template engine.
  • Start processes and manage their lifecycle
  • Watch configuration files and send configurable signals to processes on change
  • Wait until required services are up before starting before starting processes (currently supporting filesystem mounts, HTTP services, MySQL, Redis, AMQP and MongoDB)

Starting

Start as follows:

$ mittnite -config-dir /etc/mittnite.d

Or, use it in a container image:

FROM quay.io/mittwald/mittnite:stable
COPY nginx.hcl /etc/mittnite.d/webserver.hcl
COPY fpm.hcl /etc/mittnite.d/fpm.hcl
CMD ["-config-dir", "/etc/mittnite.d"]

The directory specified with -config-dir can contain any number of .hcl configuration files; all files in that directory are loaded by Mittnite on startup and can contain any of the configuration directives described in the following section:

Configuration directives

Start a process:

job webserver {
  command = "/usr/bin/http-server"

  watch "./test.txt" {
    signal = 12 # USR2
  }
}

Render a file on startup:

file test.txt {
  from = "test.d/test.txt.tpl"

  params = {
    foo = "bar"
  }
}

Wait until a Redis connection is possible:

probe redis {
  wait = true
  redis {
    host = "localhost"
  }
}

About

Small init system with templated config files; to be used as container entrypoint

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.3%
  • HCL 4.8%
  • Other 0.9%