Skip to content
Programming

Docker Compose Recipes For Local Dev

🤖 AI-generated

Master Docker Compose Recipes For Local Dev with 217 free flashcards. Study using spaced repetition and focus mode for effective learning in Programming.

217 cards · ~109 min · Advanced · Updated

Sample card

Compose file directive to mount a host directory into a container?

volumes: - ./local:/app

Share: 𝕏 Twitter LinkedIn WhatsApp ☆ Save deck

🎯 What You'll Learn

Preview cards

Q · 1 of 217

Compose file directive to mount a host directory into a container?

Q · 2 of 217

Restart a container automatically unless explicitly stopped?

Q · 3 of 217

Define an environment variable in Compose?

+9 more cards →

Preview Questions

12 shown

Compose file directive to mount a host directory into a container?

Show ▼

volumes: - ./local:/app

Restart a container automatically unless explicitly stopped?

Show ▼

restart: unless-stopped

Define an environment variable in Compose?

Show ▼

environment:<br> - KEY=value or env_file: .env

Wait for another service to be 'healthy' before starting?

Show ▼

depends_on:<br> db:<br> condition: service_healthy

Define a healthcheck for a Postgres container?

Show ▼

healthcheck:<br> test: ['CMD-SHELL','pg_isready -U postgres']<br> interval: 5s<br> retries: 10

Expose a port to the host vs to other services only?

Show ▼

ports: - '5432:5432' publishes to host.
expose: - '5432' reachable only on the Compose network.

Default Compose network name?

Show ▼

<project>_default — services on this network can resolve each other by service name.

Persist Postgres data across container recreations?

Show ▼

Use a named volume: volumes:<br> - pg_data:/var/lib/postgresql/data and declare volumes:<br> pg_data: at the bottom.

Run a one-off command without modifying compose.yml?

Show ▼

docker compose run --rm web bash

Rebuild after Dockerfile changes?

Show ▼

docker compose build (or up --build).

View logs of one service in real time?

Show ▼

docker compose logs -f web

Scale a stateless service to 3 replicas?

Show ▼

docker compose up -d --scale worker=3

🎓 Start studying Docker Compose Recipes For Local Dev

🎮 Study Modes Available

🔄

Flashcards

Flip to reveal

🧠

Focus Mode

Spaced repetition

Multiple Choice

Test your knowledge

⌨️

Type Answer

Active recall

📚

Learn Mode

Multi-round mastery

🎯

Match Game

Memory challenge

Related Topics in Programming

📖 Learning Resources