Back to articles
Docker Compose Has a Free API — Your Entire Stack in One YAML File
How-ToSystems

Docker Compose Has a Free API — Your Entire Stack in One YAML File

via Dev.to TutorialAlex Spinov

Docker Compose is the free multi-container orchestration tool that defines your entire development environment in one YAML file. Run complex stacks with docker compose up . Why Docker Compose? One command — docker compose up starts everything Declarative — define services, networks, volumes in YAML Development environment — identical setup for every team member Service discovery — containers find each other by name Hot reload — mount source code for live development Built into Docker — no separate installation since Docker 20.10+ Quick Start # compose.yaml services : app : build : . ports : - " 3000:3000" environment : - DATABASE_URL=postgresql://postgres:secret@db:5432/myapp - REDIS_URL=redis://cache:6379 depends_on : db : condition : service_healthy cache : condition : service_started volumes : - ./src:/app/src # Hot reload db : image : postgres:16 environment : POSTGRES_PASSWORD : secret POSTGRES_DB : myapp volumes : - pgdata:/var/lib/postgresql/data healthcheck : test : [ " CMD-SHE

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
3 views

Related Articles