Docker Compose describes a whole setup (app, database, cache) in one file and starts it with one command. Containers in the same file can reach each other by service name.
# compose.yaml services: app: build: . ports: - "3000:3000" environment: DATABASE_URL: postgres://app:change-me@db:5432/app depends_on: - db db: image: postgres:16 environment: POSTGRES_USER: app POSTGRES_PASSWORD: change-me volumes: - pgdata:/var/lib/postgresql/data volumes: pgdata: # then: docker compose up -d docker compose logs -f docker compose down