# Deploy a compose stack > Deploy a docker-compose.yml file from a GitHub repository to Orchard. Each service becomes its own app in the project. Source: https://docs.orchard.hackclub.com/run/compose/ A compose stack lets you bring an existing `docker-compose.yml` file to Orchard instead of creating each app by hand. Orchard reads the file from a GitHub repository and turns each service into its own app in the project, so you can scale, redeploy, and roll back each service on its own. ## Prerequisites - A GitHub repository that contains the compose file. - For a private repository, a GitHub account linked to Orchard that can read the repository. To link one, go to **Account settings** > **Connections**. A public repository works without a linked account: paste `owner/repo` into **Repository**. ## Deploy a stack **Dashboard** 1. Open the project. 2. Go to **Compose**. 3. Select **Deploy compose file**. If the project already has a stack, select **New stack**. 4. Enter a name for the stack. To deploy into another environment, select it next to the project name. 5. In **Repository**, select the repository. 6. In **Branch**, select the branch. 7. In **Path to docker-compose.yml**, confirm the path. 8. (Optional) Turn off **Auto-deploy on push**. 9. Select **Deploy stack**. Orchard opens the stack page. Builds run in the background. **CLI** ```sh orchard compose deploy --name shop --github owner/repo#main --path docker-compose.yml ``` To rebuild on each push, add `--auto-deploy`. Orchard names each app `-`. Services reach each other by their compose names, as they do in Docker Compose: `db:3306` works, on the container's port. Each name must be free in the project's environment, so two stacks with a service named `db` need separate environments or projects. A name with an underscore or another character that DNS does not allow has no such address. To find the full internal address, open the app and go to **Network** > **Ports**. ## How Orchard reads the file | Compose key | Orchard result | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `image` | An app that runs the image. | | `build` | An app that Orchard builds from the repository, with `context` and `dockerfile`. | | `ports` | The app's ports. The first TCP port that is not a known database or other non-HTTP port gets a URL, which only your organization can open until you [make it public](/deploy/protection/). | | `expose` | More ports on the app, for other services. No URL. | | `environment` | The app's [variables](/run/environments/). | | `volumes` with a named volume | A persistent volume, 1 GiB unless `driver_opts.size` sets another size. Orchard reads only the short string form. Two services cannot share a volume. | | `deploy.replicas` | The [replica count](/deploy/scaling/#change-replicas). | | `deploy.resources` | The CPU and memory sizes. | | `command` | The start command. | Each service must have `image` or `build`. Orchard does not apply these keys: - Bind mounts of host paths. For files that must persist, use a named volume or [storage](/deploy/storage/). - `network_mode` and other container networking settings. - `depends_on`. Services must tolerate a dependency that is unavailable when they start. - Build contexts that need files outside the repository. Check each service after you deploy the stack. ## Redeploy a stack Redeploying reads the compose file from GitHub again. A service that still exists keeps its app, along with its domains, volumes, and variable edits. Orchard creates or deletes apps only for services you added to or removed from the file. **Dashboard** 1. Open the stack from the project's **Compose** tab. 2. Select **Redeploy**. To turn auto-deploy on or off, use **Deploy on push to ``** on the stack page. **CLI** ```sh orchard compose redeploy ``` To turn auto-deploy on or off, run `orchard compose auto-deploy enable ` or `orchard compose auto-deploy disable `. ## Delete a stack Deleting a stack also deletes its services. **Dashboard** 1. Open the stack. 2. Select **More actions** > **Delete stack**. 3. Confirm the deletion. **CLI** ```sh orchard compose delete ``` ## Troubleshooting ### No access to the repository ```text You don't have access to this repository on GitHub. Connect your GitHub account or request access. ``` **Cause:** The repository is private, and your linked GitHub account cannot read it, or you have no linked GitHub account. **Fix:** Link your GitHub account in **Account settings** > **Connections**, and make sure that account can read the repository. To deploy on push, also install the [GitHub App](/deploy/github/#prerequisites) on the repository's account. ## Related resources - [Deploy from GitHub](/deploy/github/) - Link GitHub, install the GitHub App, and deploy a single app from a repository. - [Configure app networking](/deploy/networking/) - Change ports, internal addresses, and URLs for each app in the stack. - [Deploy and write templates](/run/templates/) - Deploy a set of apps and databases from a template instead of a compose file. - [`orchard compose` reference](/reference/cli/#compose) - Every `orchard compose` command and flag.