Skip to main content

Docker Compose Expand

Expand your docker-compose.yml file with this tool.

Install

$ pip3 install --user docker-compose-expand

Usage

Your services in docker-compose.yml file.

version: "3"
services:
  api:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9001:9001"

  products:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9002:9001"

  analysis:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9003:9001"

  monitoring:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9004:9001"

Instead of using the docker-compose tool, define the same services in the docker-compose-expand.yml file and use the docker-compose-expand tool that generates the docker-compose.yml file for your expandable services.

  • You can define variables in loop field or vars field.

  • In the loop field, you can refer to a variable which is in the vars field.

Loop Field

version: "3"
services:
  api:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9001:9001"

expand:
  vars:
  services:
    - name: "{{ name }}"
      service:
        image: ef9n/supervisord:0.1.0
        restart: on-failure
        volumes:
          - "/tmp/{{ name }}/:/opt/{{name}}/"
        ports:
          - "{{ port }}:9001"
      loop:
        - name: products
          port: 9002
        - name: analysis
          port: 9003
        - name: monitoring
          port: 9004

Vars Field

# Vars Field
version: "3"
services:
  api:
    image: ef9n/supervisord:0.1.0
    restart: on-failure
    ports:
      - "9001:9001"

expand:
  vars:
    supervisors:
      - name: products
        port: 9002
      - name: analysis
        port: 9003
      - name: monitoring
        port: 9004
  services:
    - name: "{{ name }}"
      service:
        image: ef9n/supervisord:0.1.0
        restart: on-failure
        volumes:
          - "/tmp/{{ name }}/:/opt/{{name}}/"
        ports:
          - "{{ port }}:9001"
      loop: "{{ supervisors }}"

Examples

Look up the examples directory.

Credits

Metadata

Release files for docker-compose-expand 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker-compose-expand 0.1.0
File Size Uploaded Provenance Actions
docker-compose-expand-0.1.0.tar.gz 3.3 kB Without provenance Details for docker-compose-expand-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docker-compose-expand 0.1.0
File Interpreter ABI Platform Actions
docker_compose_expand-0.1.0-py3-none-any.whl Python 3 none any Details for docker_compose_expand-0.1.0-py3-none-any.whl

Total release size: 10.1 kB

Release files / docker-compose-expand-0.1.0.tar.gz

Download URL docker-compose-expand-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3b03d700ef930c0876305b57b0286bd630639b98cba8eefb8447db908e0cf16a
BLAKE2b-256 checksum
How to use checksums
a549bb9104007bdceeb18b08420058728a37d8955fc6dc80197aff9b28476694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.10 CPython/3.7.1 Linux/4.19.12-2-MANJARO

Release files / docker_compose_expand-0.1.0-py3-none-any.whl

Download URL docker_compose_expand-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac7532d254bd0638391c287177465b3e97fd0b3d9c5848f50da2d42a466cc53f
BLAKE2b-256 checksum
How to use checksums
e93b08ea469946bbda374093458b4cd53f04ec6ba313346ffecdf74f933e1796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.10 CPython/3.7.1 Linux/4.19.12-2-MANJARO

Security for docker-compose-expand 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page