Skip to content

WasathTheekshana/doctor-cd

Repository files navigation

Doctor CD | Work in Progress (There will be many errors. Please don't judge me)

If anyone wants to, you can help me

A pull-based Continuous Deployment tool for Docker Compose applications in private networks.

Overview

Doctor CD is a GitOps-based deployment tool that monitors your GitHub repositories for changes in docker-compose files and automatically deploys updates to your private network infrastructure. It eliminates the need for complex webhook configurations or direct network access to your deployment environment.

Features

  • 🔄 Pull-based GitOps: Monitors GitHub repositories for changes
  • 🐳 Docker Compose Support: Deploys and manages Docker Compose applications
  • 🔍 Image Monitoring: Checks for new image releases in Docker registries
  • Configurable Polling: Set custom intervals for repository and registry checks
  • 🔐 Private Network Friendly: Works behind firewalls without inbound connections
  • 🏗️ Containerized: Runs as a Docker container for easy deployment

Quick Start

Using Docker Compose (Recommended)

  1. Clone this repository:
git clone https://github.com/yourusername/doctor-cd.git
cd doctor-cd
  1. Copy the example configuration:
cp configs/config.yaml.example configs/config.yaml
  1. Edit the configuration file with your repository details:
nano configs/config.yaml
  1. Start Doctor CD:
make docker-compose-up

Using Docker

docker run -d \
  --name doctor-cd \
  -v $(pwd)/configs:/app/configs \
  -v /var/run/docker.sock:/var/run/docker.sock \
  doctor-cd:latest

Building from Source

# Install dependencies
make deps

# Build the application
make build

# Run
make run

Configuration

Doctor CD uses a YAML configuration file to specify repositories, polling intervals, and deployment settings. See configs/config.yaml.example for a complete example.

repository:
  url: "https://github.com/user/repo.git"
  branch: "main"
  compose_file: "docker-compose.yaml"
  poll_interval: "5m"

registry:
  check_interval: "10m"
  username: "your-registry-username"
  password: "your-registry-password"

logging:
  level: "info"

Development

Prerequisites

  • Go 1.21+
  • Docker
  • Docker Compose
  • Make

Setup Development Environment

# Setup development environment
make setup

# Run in development mode
make dev

# Run tests
make test

# Run linter
make lint

Available Make Commands

make help  # Show all available commands

Architecture

Doctor CD follows a modular architecture:

  • Git Module: Handles repository cloning and change detection
  • Docker Module: Manages Docker Compose operations and registry interactions
  • Scheduler: Manages polling intervals and job execution
  • Deployment: Orchestrates the deployment process
  • API: Provides status and health endpoints

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions, issues, or contributions, please open an issue on GitHub.


Doctor CD - Making Docker Compose deployments in private networks simple and reliable.

About

A pull-based Continuous Deployment tool for Docker Compose applications in private networks.

Topics

Resources

License

Stars

Watchers

Forks

Contributors