{"id":15031913,"url":"https://github.com/wowu/docker-rollout","last_synced_at":"2025-05-14T04:07:38.588Z","repository":{"id":65747110,"uuid":"598306361","full_name":"wowu/docker-rollout","owner":"wowu","description":"🚀 Zero Downtime Deployment for Docker Compose","archived":false,"fork":false,"pushed_at":"2025-03-28T17:43:51.000Z","size":71,"stargazers_count":2672,"open_issues_count":6,"forks_count":79,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-11T00:44:09.987Z","etag":null,"topics":["deployment","docker","docker-compose"],"latest_commit_sha":null,"homepage":"http://docker-rollout.wowu.dev/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wowu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-06T20:44:36.000Z","updated_at":"2025-04-09T16:04:13.000Z","dependencies_parsed_at":"2023-12-09T20:24:16.103Z","dependency_job_id":"f54c7235-a2f2-46e1-9778-782c4caba90c","html_url":"https://github.com/wowu/docker-rollout","commit_stats":{"total_commits":43,"total_committers":8,"mean_commits":5.375,"dds":"0.18604651162790697","last_synced_commit":"7487c2da51f91044c8efcc3794b02ad2957e9673"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowu%2Fdocker-rollout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowu%2Fdocker-rollout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowu%2Fdocker-rollout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wowu%2Fdocker-rollout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wowu","download_url":"https://codeload.github.com/wowu/docker-rollout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069557,"owners_count":22009558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","docker","docker-compose"],"created_at":"2024-09-24T20:16:52.810Z","updated_at":"2025-05-14T04:07:38.554Z","avatar_url":"https://github.com/wowu.png","language":"Shell","readme":"\u003ch1 align=\"center\"\u003e\n\u003ccode\u003edocker rollout\u003c/code\u003e\u003cbr\u003e\nZero Downtime Deployment for Docker Compose\n\u003c/h1\u003e\n\nDocker CLI plugin that updates Docker Compose services without downtime.\n\nSimply replace `docker compose up -d \u003cservice\u003e` with `docker rollout \u003cservice\u003e` in your deployment scripts. This command will scale the service to twice the current number of instances, wait for the new containers to be ready, and then remove the old containers.\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [⚠️ Caveats](#️-caveats)\n  - [Sample deployment script](#sample-deployment-script)\n- [Why?](#why)\n- [License](#license)\n\n## Features\n\n- ⏳ Zero downtime deployment for Docker Compose services\n- 🐳 Works with Docker Compose and `docker-compose`\n- ❤️ Supports Docker healthchecks out of the box\n\n## Installation\n\n```bash\n# Create directory for Docker cli plugins\nmkdir -p ~/.docker/cli-plugins\n\n# Download docker-rollout script to Docker cli plugins directory\ncurl https://raw.githubusercontent.com/wowu/docker-rollout/main/docker-rollout -o ~/.docker/cli-plugins/docker-rollout\n\n# Make the script executable\nchmod +x ~/.docker/cli-plugins/docker-rollout\n```\n\n## Usage\n\nRun `docker rollout \u003cname\u003e` instead of `docker compose up -d \u003cname\u003e` to update a service without downtime. If you have both `docker compose` plugin and `docker-compose` command available, docker-rollout will use `docker compose` by default.\n\n```bash\n$ docker rollout -f docker-compose.yml \u003cservice-name\u003e\n```\n\nOptions:\n\n- `-f | --file FILE` - (not required) - Path to compose file, can be specified multiple times, as in `docker compose`.\n- `-t | --timeout SECONDS` - (not required) - Timeout in seconds to wait for new container to become healthy, if the container has healthcheck defined in `Dockerfile` or `docker-compose.yml`. Default: 60\n- `-w | --wait SECONDS` - (not required) - Time to wait for new container to be ready if healthcheck is not defined. Default: 10\n- `--wait-after-healthy SECONDS` - (not required) - Time to wait after new container is healthy before removing old container. Works when healthcheck is defined. Default: 0\n- `--env-file FILE` - (not required) - Path to env file, can be specified multiple times, as in `docker compose`.\n\nSee [examples](https://docker-rollout.wowu.dev/examples/) in docs for sample `docker-compose.yml` files.\n\n### ⚠️ Caveats\n\n- Your service cannot have `container_name` and `ports` defined in `docker-compose.yml`, as it's not possible to run multiple containers with the same name or port mapping. Use a proxy as described below.\n- Proxy like [Traefik](https://github.com/traefik/traefik) or [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) is required to route traffic.\n- Each deployment will increment the index in container name (e.g. `project-web-1` -\u003e `project-web-2`).\n\n### Sample deployment script\n\nSample deployment script for `web` service:\n\n```bash\n# Download latest code\ngit pull\n# Build new app image\ndocker compose build web\n# Run database migrations\ndocker compose run web rake db:migrate\n# Deploy new version\ndocker rollout web\n```\n\n## Why?\n\nUsing `docker compose up` to deploy a new version of a service causes downtime because the app container is stopped before the new container is created.\nIf your application takes a while to boot, this may be noticeable to users.\n\nUsing container orchestration tools like [Kubernetes](https://kubernetes.io/) or [Nomad](https://www.nomadproject.io/) is usually an overkill for projects that will do fine with a single-server Docker Compose setup. [Dokku](https://github.com/dokku/dokku) comes with zero-downtime deployment and more useful features, but it's not as flexible as Docker Compose.\n\nIf you have a proxy like [Traefik](https://github.com/traefik/traefik) or [nginx-proxy](https://github.com/nginx-proxy/nginx-proxy), a zero downtime deployment can be achieved by writing a script that scales the service to 2 instances, waits for the new container to be ready, and then removes the old container.\n`docker rollout` does exactly that, but with a single command that you can use in your deployment scripts.\nIf you're using Docker healthchecks, Traefik will make sure that traffic is only routed to the new container when it's ready.\n\n## License\n\n[MIT License](LICENSE) \u0026copy; Karol Musur\n","funding_links":[],"categories":["Shell","docker-compose"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwowu%2Fdocker-rollout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwowu%2Fdocker-rollout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwowu%2Fdocker-rollout/lists"}