Share feedback
Answers are generated based on the documentation.

Lab: Docker Compose Quickstart

Build a Python Flask and Redis hit-counter app using Docker Compose, starting from a bare compose.yaml and progressively adding production-quality features at each step.

Launch the lab

  1. Start the labspace:

    $ docker compose -f oci://dockersamples/labspace-compose-quickstart up -d
    
  2. Open your browser to http://localhost:3030.

What you'll learn

By the end of this Labspace, you will have completed the following:

  • Define a multi-service application in a compose.yaml file and manage it with Compose commands
  • Control service startup order using health checks and depends_on conditions
  • Iterate on code without manual rebuilds using Compose watch mode
  • Persist data across container restarts with named volumes
  • Modularize a stack across multiple files using the include directive
  • Use config, logs, and exec to inspect and debug a running stack

Modules

#ModuleDescription
1IntroductionTour the starter app and verify the environment
2Defining ServicesWrite the first compose.yaml and bring up the Flask and Redis stack
3Health Checks & Startup OrderAdd a Redis healthcheck and depends_on to eliminate race conditions
4Live Development with Watch ModeConfigure watch mode to sync code changes without manual rebuilds
5Persistence & DebuggingAdd a named volume so Redis data survives docker compose down
6Using Multiple Compose FilesExtract Redis into infra.yaml and compose files with include
7Additional CommandsUse config, logs -f, and exec to inspect the running stack
8RecapReview what was built and explore next steps