Skip to main content

A Python wrapper for generating a compose file

Project description

dockercomposeHelp

dockercomposeHelp is a python package for building complex docker-compose files quickly and without errors. It only supports Compose file version 3.

Usage:

It follows a very simple usage procedure:

from dockercomposeHelp.compose import Compose
my_compose = Compose() #create a compose instance
service_db = Service('db') #create a service instance
service_db.image('mysql')
service_db.command('--default-authentication-plugin=mysql_native_password')
service_db.restart('always')
service_db.environment({'MYSQL_ROOT_PASSWORD': 'example'})
service_db.ports(['8080:8080'])

my_compose.add_service(service_db) #add service to compose
my_compose.make_compose() #output compose

The above code snippet will produce the following yaml file:

services:
  db:
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: example
    image: mysql
    ports:
      - 8080:8080
    restart: always
version: '3.7'

To be added:

  • service.deploy.rollback_config
  • service.deploy.update_config
  • service.pid
  • service.secrets
  • service.security_opt
  • service.stop_grace_period
  • service.stop_signal
  • service.sysctls
  • service.tmpfs
  • service.ulimits
  • service.userns_mode

Unsupported:

  • service.links -- LEGACY FEATURE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
dockercomposeHelp-1.0.0-py3-none-any.whl (8.2 kB) Copy SHA256 hash SHA256 Wheel py3
dockercomposeHelp-1.0.0.tar.gz (7.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page