Skip to content

Dependencies Configuration

The dependencies section defines supporting services like databases that your application requires.

Configuration Fields

yaml
dependencies:
  - name: postgres
    image: postgres:16
    volumes:
      - postgres_data:/var/lib/postgresql/data
    env:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_DB=${POSTGRES_DB:-app}
FieldDescription
nameUnique identifier for the dependency
imageDocker image to use for this dependency
volumesVolume mounts for persistent storage
envEnvironment variables for the dependency

Environment Variables

Dependencies support environment variable substitution with required variables and optional variables with defaults:

yaml
dependencies:
  - name: postgres
    env:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} # Required
      - POSTGRES_USER=${POSTGRES_USER:-postgres} # Optional with default
      - POSTGRES_DB=${POSTGRES_DB:-app} # Optional with default

Required variables must be set in the environment before running FTL commands. Optional variables will use their default values if not set.

Example

yaml
dependencies:
  - name: postgres
    image: postgres:16
    volumes:
      - postgres_data:/var/lib/postgresql/data
    env:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_DB=${POSTGRES_DB:-app}

This configuration:

  • Creates a PostgreSQL database service
  • Uses the official PostgreSQL 16 image
  • Mounts persistent storage for the database
  • Sets required and optional environment variables

Released under the MIT License.