Skip to main content

Docker Compose Commands

Run Docker Compose applications on Lyceum Cloud with support for multi-container orchestration, custom machine types, and private registries.

Commands

CommandDescription
lyceum compose runExecute a Docker Compose application on Lyceum Cloud
lyceum compose logsStream logs from a Docker Compose execution
lyceum compose registry-examplesShow Docker registry credential format examples

lyceum compose run

Execute a Docker Compose application on Lyceum Cloud.
lyceum compose run <compose_file>
By default, streams container output in real-time. Use --detach to run in background and return immediately.

Arguments

ArgumentDescription
compose_file(required) Path to docker-compose.yml file

Options

OptionDescription
--machine, -mMachine type (cpu, a100, h100, etc.). Default: cpu
--timeout, -tExecution timeout in seconds. Default: 300
--file-name, -fName for the execution
--detach, -dRun in background and print execution ID
--callbackWebhook URL for completion notification
--registry-credsDocker registry credentials as JSON string
--registry-typeRegistry credential type (basic, aws, etc.)

Examples

# Run a basic compose application
lyceum compose run docker-compose.yml

# Run from a subdirectory
lyceum compose run ./app/docker-compose.yml

# Run on GPU machine
lyceum compose run docker-compose.yml -m a100

# Run in background (detached mode)
lyceum compose run docker-compose.yml --detach

# Set custom timeout (10 minutes)
lyceum compose run docker-compose.yml --timeout 600

# With webhook callback
lyceum compose run docker-compose.yml --callback https://myapp.com/webhook

# With custom execution name
lyceum compose run docker-compose.yml -f "my-app-staging"

Private Registry Authentication

# Basic auth for private registry
lyceum compose run docker-compose.yml \
  --registry-type basic \
  --registry-creds '{"username": "user", "password": "pass"}'

# AWS ECR
lyceum compose run docker-compose.yml \
  --registry-type aws \
  --registry-creds '{"access_key_id": "...", "secret_access_key": "...", "region": "us-east-1"}'

Docker Compose File Example

version: '3.8'
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"

  app:
    image: myapp:latest
    environment:
      - DATABASE_URL=postgresql://db:5432/mydb
    depends_on:
      - db

  db:
    image: postgres:15
    environment:
      - POSTGRES_PASSWORD=secret
All services defined in your docker-compose.yml will run on the same machine instance, with resources shared according to the selected machine type.

lyceum compose logs

Stream logs from a running or completed Docker Compose execution.
lyceum compose logs <execution_id>

Arguments

ArgumentDescription
execution_id(required) Execution ID to stream logs from

Examples

# Stream logs from an execution
lyceum compose logs 9d73319c-6f1c-4b4c-90e4-044244353ce4

# Get execution ID from detached run
EXEC_ID=$(lyceum compose run docker-compose.yml --detach)
lyceum compose logs $EXEC_ID
Logs from all services in your compose application are streamed together with service name prefixes for easy identification.

lyceum compose registry-examples

Display example credential formats for various Docker registries.
lyceum compose registry-examples
This shows JSON formats for:
  • Basic authentication
  • AWS ECR
  • Google Container Registry
  • Azure Container Registry

Machine Types for Compose

When running multi-container applications, choose a machine type that can handle all services:
Machine TypevCPUMemoryBest For
cpu416 GBDevelopment, lightweight apps
a100864 GBML workloads, GPU-accelerated apps
h100880 GBHigh-performance compute
All containers in your compose application share the resources of the selected machine. Plan your resource allocation accordingly.

Common Use Cases

# docker-compose.yml
version: '3.8'
services:
  web:
    image: mycompany/webapp:latest
    ports:
      - "8080:8080"
    environment:
      - DB_HOST=db
    depends_on:
      - db

  db:
    image: postgres:15
    environment:
      - POSTGRES_PASSWORD=secret
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  db-data:
lyceum compose run docker-compose.yml -m cpu
# docker-compose.yml
version: '3.8'
services:
  trainer:
    image: mycompany/ml-trainer:latest
    environment:
      - EXPERIMENT_NAME=run-001
      - EPOCHS=100
    volumes:
      - ./data:/data
      - ./models:/models
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
lyceum compose run docker-compose.yml -m a100 --timeout 3600
# docker-compose.yml
version: '3.8'
services:
  api:
    image: mycompany/api:latest
    ports:
      - "3000:3000"

  worker:
    image: mycompany/worker:latest
    environment:
      - QUEUE_URL=redis://redis:6379

  redis:
    image: redis:7-alpine

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
    depends_on:
      - api
lyceum compose run docker-compose.yml \
  --detach \
  --callback https://monitoring.myapp.com/webhook

Troubleshooting

Issue: Services starting before dependencies are readySolution: Use depends_on with health checks in your compose file:
services:
  app:
    depends_on:
      db:
        condition: service_healthy

  db:
    healthcheck:
      test: ["CMD", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5
Issue: Containers using too much memorySolution: Set resource limits in your compose file:
services:
  app:
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 4G
        reservations:
          cpus: '1'
          memory: 2G
Issue: Cannot pull images from private registrySolution: Provide registry credentials:
lyceum compose run docker-compose.yml \
  --registry-type basic \
  --registry-creds '{"username":"user","password":"pass"}'