Use docker-compose to manage multiple apps on a single host
Project description
Docker0s uses docker-compose to manage multiple containerised apps on a single host.
Bring together standard docker-compose files across multiple projects in a single simple manifest file, written in either YAML or Python with pre- and post-operation hooks, to deploy to a single host.
It’s designed for small self-hosted low-maintenance deployments which don’t need the complexity of Kubernetes - think k8s with zero features and a much simpler config syntax, with simple app manifests instead of helm charts.
There is a collection of ready-to-use app manifests at docker0s-manifests, with examples for how to deploy them to your host.
Project site: https://radiac.net/projects/docker0s/
Documentation: https://docker0s.readthedocs.io/
Source code: https://github.com/radiac/docker0s
Quickstart
Install:
pip install docker0s
Put together a manifest in YAML as d0s-manifest.yml:
apps:
traefik:
path: git+https://github.com/radiac/docker0s-manifests.git@main#traefik
env_file: traefik.env
storage:
path: ../apps/storage
website:
type: MountedApp
path: "git+ssh://git@github.com:radiac/example.com.git@main"
env:
DOMAIN: example.radiac.net
host:
name: example.radiac.net
or in Python as d0s-manifest.py, using subclassing to perform actions before and after operations and add custom functionality:
from docker0s import MountedApp
class Website(MountedApp):
# Clone a repo to the host and look for docker-compose.yml in there
path = "git+ssh://git@github.com:radiac/example.com.git@main"
env = {
"DOMAIN": "example.radiac.net"
}
# Subclass operation methods to add your own logic
def deploy(self):
# Perform action before deployment, eg clean up any previous deployment
super().deploy()
# Perform action after deployment, eg push additional resources
class Vagrant(Host):
name = "vagrant"
See writing manifests for a full reference
Then run a command, eg:
docker0s deploy docker0s up docker0s restart website.django docker0s exec website.django /bin/bash docker0s cmd website app_command arguments
See commands for a full command reference
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.