{"id":15292890,"url":"https://github.com/turnerlabs/harbor-compose","last_synced_at":"2025-05-07T04:25:43.688Z","repository":{"id":87027485,"uuid":"61904176","full_name":"turnerlabs/harbor-compose","owner":"turnerlabs","description":"A tool for running containerized applications on Harbor","archived":false,"fork":false,"pushed_at":"2018-10-08T15:29:35.000Z","size":21728,"stargazers_count":16,"open_issues_count":16,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-19T18:31:16.166Z","etag":null,"topics":["cloud","compose","container","docker","docker-compose","harbor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turnerlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2016-06-24T18:22:25.000Z","updated_at":"2024-12-11T07:32:55.000Z","dependencies_parsed_at":"2023-05-30T06:15:13.584Z","dependency_job_id":null,"html_url":"https://github.com/turnerlabs/harbor-compose","commit_stats":null,"previous_names":[],"tags_count":169,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Fharbor-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Fharbor-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Fharbor-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Fharbor-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turnerlabs","download_url":"https://codeload.github.com/turnerlabs/harbor-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252812001,"owners_count":21808059,"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":["cloud","compose","container","docker","docker-compose","harbor"],"created_at":"2024-09-30T16:29:50.596Z","updated_at":"2025-05-07T04:25:43.665Z","avatar_url":"https://github.com/turnerlabs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# harbor-compose\n\nA tool for defining and running multi-container Docker applications on Harbor.\n\n[![CircleCI](https://circleci.com/gh/turnerlabs/harbor-compose/tree/master.svg?style=shield)](https://circleci.com/gh/turnerlabs/harbor-compose/tree/master)  \n\nWith Harbor Compose, you start with a standard [Docker Compose](https://docs.docker.com/compose/) file to configure your application’s services. You then add a Harbor Compose file to configure Harbor-specific settings.  Then, using a single command, you create and start all the services from your configuration.\n\nUsing Harbor Compose is basically a four-step process.\n\n1. Define your app’s environment with a `Dockerfile` so it can be reproduced anywhere.\n\n2. Define the services that make up your app in `docker-compose.yml` so they can be run together in an isolated environment.  You can use the standard Docker Compose commands (like `docker-compose build`, `docker-compose push`, `docker-compose up`, etc.) to build/run/test your Docker app locally.\n\n3. When you're ready to launch your Docker app on Harbor, you define the Harbor-specific parameters in a [`harbor-compose.yml`](compose-reference.md) file.\n\n4. Run `harbor-compose up` and Harbor Compose will start and run your entire app on a managed barge.\n\n\nJust like `docker-compose`, `harbor-compose` has similar commands for managing the life cycle of your app on Harbor:\n\n- Start and stop services\n- Upload environment variables and scale replicas\n- View the status of running services\n- Stream the log output of running services\n- Trigger an image deployment from a public build system (like Circle CI, Travis CI, etc.)\n\n\nA simple [`docker-compose.yml`](https://docs.docker.com/compose/compose-file/compose-file-v2/) might look like this:\n\n```yaml\nversion: \"2\"\nservices:\n  web-app:\n    image: quay.io/turner/my-web-app:1.0.0\n    ports:\n      - \"80:5000\"\n    environment:\n      HEALTHCHECK: /hc\n      PORT: 5000\n```\n\nA [`harbor-compose.yml`](compose-reference.md) might look like this:\n\n```yaml\nversion: \"1\"\nshipments:\n  my-web-app:\n    env: dev\n    barge: digital-sandbox\n    containers:\n      - web-app    \n    replicas: 2\n    group: mss\n    property: turner\n    project: turner\n    product: turner\n```\n\nThen to start your application...\n\n```\n$ harbor-compose up\n```\n\nAccess your app logs...\n\n```\n$ harbor-compose logs\n```\n\nGet the status of your shipments...\n\n```\n$ harbor-compose ps\n```\n\nTo stop your application, remove all running containers and delete your load balancer...\n\n```\n$ harbor-compose down\n```\n\n### Compose file reference\n\nSee the [full harbor-compose.yml reference](compose-reference.md) along with which [docker-compose.yml](https://docs.docker.com/compose/) properties are supported by Harbor Compose.\n\n\n#### Getting Started\n\nThere are currently two installation options for Harbor Compose.\n\n1) Download the latest binary from [Github releases](https://github.com/turnerlabs/harbor-compose/releases).\n\n```\ncurl -s get-cli.harbor.turnerlabs.io | sh\n```\n\n2) Run as a docker container\n\n```\ndocker run -it --rm -v `pwd`:/work quay.io/turner/harbor-compose up\n```\n\n- or if you want to reuse your session:\n\n```\ndocker run -it —rm -v `pwd`:/work -v ${HOME}/.harbor:/root/.harbor quay.io/turner/harbor-compose up\n```\n\n\nTo get started with an existing shipment, you can run the following to generate [`docker-compose.yml`](https://docs.docker.com/compose/compose-file/compose-file-v2/) and [`harbor-compose.yml`](compose-reference.md) files, by specifying the shipment name and environment as args.  Note that you will be prompted to login if you don't already have a token or if your token has expired.  For example:\n\n```\n$ harbor-compose generate my-shipment dev\n```\n\nTo create new shipments, you can use the `init` command to generate new [`docker-compose.yml`](https://docs.docker.com/compose/compose-file/compose-file-v2/) and [`harbor-compose.yml`](compose-reference.md) files.  `init` will ask you questions to build your compose files.  Note that you use the `--yes` flag to accept defaults and generate one quickly.\n\n```\n$ harbor-compose init\n```\n\nThis will output the files in the current directory.  You can then run a bunch of useful commands, for example...\n\nRun your shipment locally in Docker (practically identically to how it runs in Harbor)...\n\n```\n$ docker-compose up\n```\n\nPush your images to a registry.\n\n```\n$ docker-compose push\n```\n\nScale your shipment by changing the replicas in `harbor-compose.yml`, or change your environment variables and re-deploy, or deploy a new image, etc....\n\n```\n$ harbor-compose up\n```\n\nGet the status of your shipment(s) using the `ps` command.  With this command you can see the status of each container replica, when it started and the last known state.  For example:\n\n```\n$ harbor-compose ps\n\nSHIPMENT:      mss-poc-multi-container   \nENVIRONMENT:   dev                       \nSTATUS:        Running                   \nCONTAINERS:    2                         \nREPLICAS:      2\n\nID        IMAGE                                                        STATUS    STARTED      RESTARTS   LAST STATE              \nab97cef   quay.io/turner/mss-poc-multi-container:1.0.0    running   1 week ago   1          terminated 1 week ago   \n873a390   quay.io/turner/mss-poc-multi-container2:1.0.0   running   1 week ago   1          terminated 1 week ago   \n73fad42   quay.io/turner/mss-poc-multi-container:1.0.0    running   5 days ago   2          terminated 5 days ago   \ndb93650   quay.io/turner/mss-poc-multi-container2:1.0.0   running   5 days ago   2          terminated 5 days ago   \n```\n\nYou can also manage multiple shipments using Harbor Compose by listing them in your harbor-compose.yml file.  This is particularly useful if you have a web/worker, or microservices type application where each shipment can be scaled independently.\n\n\n#### Authentication\n\nSome commands (`up`, `down`, `generate`) require authentication and will automatically prompt you for your credentials.  A temporary (6 hours) authentication token is stored on your machine so that you don't have to login when running each command.  If you want to logout and remove the authentication token, you can run the `logout` command.  You can also explicitly login by running the `login` command.\n\n\n#### CI/CD\n\nSee the [CI/CD doc](cicd.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturnerlabs%2Fharbor-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturnerlabs%2Fharbor-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturnerlabs%2Fharbor-compose/lists"}