Home Explore Blog CI



docker

6th chunk of `content/manuals/compose/gettingstarted.md`
dc61a3b9a88e6b47ae6f5f8a1da0e245cc6dbcc2373049ca00000001000002b6


3. Once you're done, run `docker compose down`.

## Step 7: Split up your services

Using multiple Compose files lets you customize a Compose application for different environments or workflows. This is useful for large applications that may use dozens of containers, with ownership distributed across multiple teams. 

1. In your project folder, create a new Compose file called `infra.yaml`.

2. Cut the Redis service from your `compose.yaml` file and paste it into your new `infra.yaml` file. Make sure you add the `services` top-level attribute at the top of your file. Your `infra.yaml` file should now look like this:

Title: Updating the Application and Splitting Up Services
Summary
This section demonstrates the updated application in a web browser displaying the message 'Hello from Docker! I have been seen 3 times.' and then guides the user to shut down the application using `docker compose down`. The section then proceeds to explain how to split services into multiple Compose files for customization in different environments or workflows. It instructs the user to create a new `infra.yaml` file, move the Redis service from `compose.yaml` to `infra.yaml`, and ensure the `services` top-level attribute is added.