Home Explore Blog CI



docker

3rd chunk of `content/get-started/docker-concepts/the-basics/what-is-docker-compose.md`
7a90abd75c52b19d9dcd1720ce114adf98d1f6aa41ce16a60000000100000c49
    A lot happened here! A couple of things to call out:

    - Two container images were downloaded from Docker Hub - node and MySQL
    - A network was created for your application
    - A volume was created to persist the database files between container restarts
    - Two containers were started with all of their necessary config

    If this feels overwhelming, don't worry! You'll get there!

5. With everything now up and running, you can open [http://localhost:3000](http://localhost:3000) in your browser to see the site. Feel free to add items to the list, check them off, and remove them.

    ![A screenshot of a webpage showing the todo-list application running on port 3000](images/todo-list-app.webp?border=true&w=950&h=400)

6. If you look at the Docker Desktop GUI, you can see the containers and dive deeper into their configuration.

    ![A screenshot of Docker Desktop dashboard showing the list of containers running todo-list app](images/todo-list-containers.webp?border=true&w=950&h=400)


### Tear it down

Since this application was started using Docker Compose, it's easy to tear it all down when you're done.

1. In the CLI, use the [`docker compose down`](/reference/cli/docker/compose/down/) command to remove everything:

    ```console
    docker compose down
    ```

    You'll see output similar to the following:

    ```console
    [+] Running 3/3
    ✔ Container todo-list-app-mysql-1  Removed        2.9s
    ✔ Container todo-list-app-app-1    Removed        0.1s
    ✔ Network todo-list-app_default    Removed        0.1s
    ```

    > **Volume persistence**
    >
    > By default, volumes _aren't_ automatically removed when you tear down a Compose stack. The idea is that you might want the data back if you start the stack again.
    >
    > If you do want to remove the volumes, add the `--volumes` flag when running the `docker compose down` command:
    >
    > ```console
    > docker compose down --volumes
    > [+] Running 1/0
    > ✔ Volume todo-list-app_todo-mysql-data  Removed
    > ```

2. Alternatively, you can use the Docker Desktop GUI to remove the containers by selecting the application stack and selecting the **Delete** button.

    ![A screenshot of the Docker Desktop GUI showing the containers view with an arrow pointing to the "Delete" button](/Users/baehyunsol/Documents/Rust/ragit/sample/docker/content/get-started/docker-concepts/the-basics/images/todo-list-delete.webp?w=930&h=400)

    > **Using the GUI for Compose stacks**
    >
    > Note that if you remove the containers for a Compose app in the GUI, it's removing only the containers. You'll have to manually remove the network and volumes if you want to do so.

In this walkthrough, you learned how to use Docker Compose to start and stop a multi-container application.


## Additional resources

This page was a brief introduction to Compose. In the following resources, you can dive deeper into Compose and how to write Compose files.


* [Overview of Docker Compose](/compose/)
* [Overview of Docker Compose CLI](/compose/reference/)
* [How Compose works](/compose/intro/compose-application-model/)

Title: Accessing and Tearing Down the To-Do List Application
Summary
After starting the application, it can be accessed via a web browser and interacted with. The Docker Desktop GUI provides a way to inspect the containers. To stop the application, the `docker compose down` command removes the containers and network. Volumes persist by default, but can be removed using the `--volumes` flag with the `docker compose down` command or through the Docker Desktop GUI. This section concludes the walkthrough and offers further resources on Docker Compose.