Skip to main content

A wrapper for docker-compose that adds a network to all services.

Project description

Docker Network Integration Script (ncomp)

Overview

This script is designed to streamline the process of integrating a custom network into Docker Compose services. It automates the task of adding a specified network to all services in a Docker Compose file and ensures the network is properly defined and recognized by Docker Compose.

Features

  • Automatic Network Creation: Creates a Docker network if it does not already exist.
  • Dynamic Network Integration: Adds a specified network to all services in a Docker Compose file.
  • Custom Network Support: Supports custom network names as specified by the user environment.
  • Error Handling: Provides error output if the Docker Compose process encounters issues.

Requirements

  • Python 3.x
  • Docker Python SDK
  • PyYAML

Environment Variables

  • SHARED_NETWORK: The name of the network to be integrated into Docker Compose services. Default is "shared_network".
  • COMPOSE_FILE: The path to the Docker Compose file. Default is "docker-compose.yml".

Usage

  1. Set Environment Variables (optional): Define SHARED_NETWORK and COMPOSE_FILE if you want to use custom values.
  2. Run the Script: Execute the script in the same directory as your Docker Compose file or specify the path using the COMPOSE_FILE environment variable.

Example

# Run with custom network name and Docker Compose file
SHARED_NETWORK=my_network COMPOSE_FILE=my_docker_compose.yml ncomp up

Project details


Download files

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

Source Distribution

ncomp-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

ncomp-0.1.0-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ncomp-0.1.0.tar.gz.

File metadata

  • Download URL: ncomp-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for ncomp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 416fa3efc6a26548b7e656bcaa5df442ca6ea2c9c7bcc030e083078f1e0b5254
MD5 6640efa4b7533fa8225093e5d1988cbd
BLAKE2b-256 b998851c5b2efbd9ad0e4fea1d2052a20fc570e190afdd425842c943ccf90b48

See more details on using hashes here.

File details

Details for the file ncomp-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ncomp-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for ncomp-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f3ba802ca18fefab7ff98b2dbde613da87f5f6bf7c76f33d24d325134ca79f08
MD5 59eacf92c448c087c63e2791dc91841f
BLAKE2b-256 5cc87d3008f34e318fc87a485281a2f8f9be8ef4174b433e7ab26fa7ad864f8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page