/ServiceManager

Manage web services with docker-compose and haproxy

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

ServiceManager

Manage web services with docker-compose and haproxy

Warning: This programm is under heavy development and probably not very stable

Usage

Start the command line interface

python CLI.py

For a full list of commands check the Wiki


Create a new or select an existing top level domain

ServiceManager>select domain example.com
selected domain "example.com"

After selecting a domain, get all current subdomains for it

ServiceManager>list subdomain
avaibale subdomains:
    blog.example.com
    nextcloud.example.com

Create a new or select an existing subdomain, add a module to it and bring that module up

ServiceManager>create sd blog
selected subdomain "blog.example.com"
ServiceManager>create md WordPress
created module "WordPress"
ServiceManager>up md
Creating network "bin_blog-example-com" with the default driver
Creating blog-example-com_mysql ... done
Creating blog-example-com_wordpress ... done
module "WordPress" is coming up

Usaging the ServiceManager directly

from ServiceManager import ServiceManager
# Init manager
manager = ServiceManager()
# Create a new top level domain
domain = manager.domain('example.com')
# Within a top level domain, you can create subdomains
# that can each hold one module (e.g. a WordPress instance)
blogSubDomain = domain.subDomain('blog')    # This will create the subdomain "blog.example.com"
blogWp = WordPress(blogSubDomain)
# This starts all containers needed for WordPress and generates ssl certificates
# and haproxy bindings. Afterwards the site can be accessed via "blog.example.com"
blogWp.up()
# To access the top level domain itself ("example.com"),
# you have to create a subdomain for it as well
mainSubDomain = domain.subDomain('example.com')

Dependencies

  • Docker
  • Docker-Compose
  • haproxy
  • certbot