Explain Docker Compose files

Paste the docker-compose.yml your AI wrote and Vibe explains what each service runs, where its settings come from and what starts first, so you can tell whether it does what you asked.

docker-compose.yml

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe24 lines selected

Press Explain it for the sample, or paste your own code first.

What this Docker Compose sample shows

services
web and db are 2 containers Compose starts together. web is built from the Dockerfile in the same folder (build: .), and db runs the published postgres:16 image. Compose puts both on one network, shop_default for a folder called shop, where Docker's docs say each container is discoverable by its service name. That is why the URL says @db:5432 and not localhost.
variable substitution
${POSTGRES_PASSWORD} is filled in when Compose reads the file. With a .env file holding a test value next to the Compose file, docker compose config showed that value in both places, in POSTGRES_PASSWORD and inside DATABASE_URL.
startup order
depends_on: with - db under it means db is started first, nothing more. Compose read it as condition: service_started, and Docker's docs say Compose waits until a container is running, not until it's ready, so web can try to connect before Postgres accepts connections. A healthcheck on db plus condition: service_healthy under depends_on makes web wait, and Compose accepted that version too.
ports
"8000:8000" maps port 8000 on your computer to port 8000 in the container. "5432:5432" does the same for the database, and with no host address Docker's docs say it publishes on all host addresses, so other machines that can reach yours may be able to reach the database too. web doesn't need that mapping: containers reach db over the Compose network. "127.0.0.1:5432:5432" came out as host_ip: 127.0.0.1, and Docker's docs say that then only your own machine can reach the port (from Docker 28.0.0 on).
named volumes
pgdata keeps the database's files in a Docker volume, outside the container. Its real name starts with the project name, which by default is the name of the folder that holds the Compose file: in a folder called shop it came out as shop_pgdata, and with -p myproject as myproject_pgdata. Put the same file in a folder with another name, or rename the folder, and the volume name changes with it, so the data saved in shop_pgdata isn't in the new one.

Good to know

  • version: "3.8" does nothing in current Compose. Compose v5.0.2 warned "the attribute version is obsolete, it will be ignored" and read the rest of the file.
  • With the volumes: block at the bottom taken out, Compose refused the file: service "db" refers to undefined volume pgdata: invalid compose project.
  • With a tab in front of db: on line 12, Compose stopped with exit code 1 and yaml: line 11: found a tab character that violates indentation, naming the line above the tab. Compose files are YAML, so spaces set the nesting.
  • Checked with docker compose config in Docker Compose v5.0.2 on Linux, which reads and resolves the file without starting containers. It doesn't check that the image exists or that the app starts.

Before you trust it: A missing password doesn't stop Compose from reading the file. With no .env and nothing set in the shell, docker compose config printed The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string. twice, made the URL postgres://app:@db:5432/app and still exited with code 0. Writing ${POSTGRES_PASSWORD:?set it in .env} in the URL made it stop instead, with required variable POSTGRES_PASSWORD is missing a value: set it in .env and exit code 1.

Explain Docker Compose files beside your editor

When your AI tool writes Docker Compose files, select the code in any app and press the shortcut. On a Mac that's Control+U, not Command+U (⌘U only works in Cursor and VS Code with the editor bridge). On Windows it's Ctrl+Alt+U. Vibe explains it beside your editor, you can ask it why, and Test me checks that you followed. Unvibe is a free app for Mac and Windows.

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

No install warning? Use Unvibe in your browser

Opening the .dmg the first time

Unvibe isn't notarized by Apple yet, so macOS blocks the first open until you allow it. Its code is public on GitHub.

  1. Open the .dmg, drag Unvibe to Applications and open it. macOS says it can't verify it. Click Done, not the blue Move to Trash.
    macOS dialog: “Unvibe” Not Opened, with a blue Move to Trash button on top and Done under it
    Real screen, macOS 26. On macOS 15 the two buttons sit side by side.
  2. System Settings › Privacy & Security, scroll down to Security, then press Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15
  3. Unvibe opens. You only do this once, and later versions install from inside the app with one click.
    Unvibe's first window: Vibe says Hey! I'm Vibe. I explain the code AI writes for you, right beside your editor, over the title Understand the code AI writes
    Real screen, Unvibe 0.1.51 on macOS 26

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open