Docker Compose
EMB wraps Docker Compose to provide a consistent interface for running services. This page covers the essential commands for managing your application.
Docker Compose File
Section titled “Docker Compose File”EMB uses your project’s docker-compose.yml:
cat docker-compose.ymlservices: api: image: fullstack-app/api:${DOCKER_TAG:-latest} ports: - "${API_PORT:-3000}:3000" environment: - NODE_ENV=${NODE_ENV:-development}
web: image: fullstack-app/web:${DOCKER_TAG:-latest} ports: - "${WEB_PORT:-8080}:80" depends_on: - apiThe file references EMB-managed images and environment variables.
Starting Services
Section titled “Starting Services”Start all services with:
emb upThis will:
- Build any images that need building
- Create and start all containers
- Show logs in real-time
Start specific services:
emb up apiDetached Mode
Section titled “Detached Mode”Run in the background:
emb up -dOr the long form:
emb up --detachViewing Status
Section titled “Viewing Status”Check running containers:
emb psThis shows container status, ports, and health.
Viewing Logs
Section titled “Viewing Logs”Follow logs for all services:
emb logsFollow a specific service:
emb logs apiGet recent logs without following:
emb logs --no-follow apiStopping Services
Section titled “Stopping Services”Stop all services:
emb downThis stops and removes containers, networks, and volumes created by up.
Restarting Services
Section titled “Restarting Services”Restart all services:
emb restartRestart specific services:
emb restart apiGetting a Shell
Section titled “Getting a Shell”Open a shell in a running container:
emb shell apiThis opens an interactive shell (typically /bin/sh or /bin/bash).
Environment Integration
Section titled “Environment Integration”EMB automatically passes your project’s environment variables to Docker Compose. This means:
- Variables from
.envfiles are available - Variables defined in the
env:section are available - Command-line overrides work:
NODE_ENV=production emb up
Next Step
Section titled “Next Step”Continue to Building Images to learn about building and tagging Docker images.