Skip to content

Configuration File Reference

FTL uses a YAML configuration file (ftl.yaml) to define project settings, server configurations, services, dependencies, and volumes.

File Structure

yaml
project: # Project-level configuration
servers: # Server definitions
services: # Application services
dependencies: # Supporting services
volumes: # Persistent storage definitions

Project Configuration

Top-level project settings that define basic information about your deployment.

yaml
project:
  name: my-project # Required: Project identifier
  domain: my-project.example.com # Required: Primary domain for the project
  email: [email protected] # Required: Contact email for SSL certificates
FieldTypeRequiredDescription
namestringYesProject identifier used for resource naming
domainstringYesPrimary domain for the deployment
emailstringYesContact email used for SSL certificate management

Server Configuration

Defines the target servers for deployment.

yaml
servers:
  - host: my-project.example.com # Required: Server hostname or IP
    port: 22 # Optional: SSH port (default: 22)
    user: my-project # Required: SSH user
    ssh_key: ~/.ssh/id_rsa # Required: Path to SSH private key
FieldTypeRequiredDefaultDescription
hoststringYes-Server hostname or IP address
portintegerNo22SSH port number
userstringYes-SSH username for authentication
ssh_keystringYes-Path to SSH private key file

Services

Defines the application services to be deployed.

yaml
services:
  - name: my-app # Required: Service identifier
    image: my-app:latest # Optional: Docker image name
    build: # Optional: Build configuration
      context: . # Required for build: Build context path
      dockerfile: Dockerfile # Optional: Dockerfile path
    port: 80 # Required: Container port to expose
    health_check: # Optional: Health check configuration
      path: / # Required for health check: HTTP path
      interval: 10s # Optional: Check interval
      timeout: 5s # Optional: Check timeout
      retries: 3 # Optional: Number of retries
    routes: # Required: Routing configuration
      - path: / # Required: URL path to match
        strip_prefix: false # Optional: Strip path prefix
FieldTypeRequiredDefaultDescription
namestringYes-Unique service identifier
imagestringNo-Docker image for registry-based deployment
buildobjectNo-Build configuration for direct transfer
portintegerYes-Container port to expose
health_checkobjectNo-Health check configuration
routesarrayYes-Nginx routing configuration

Dependencies

Defines supporting services required by the application.

yaml
dependencies:
  - name: postgres # Required: Dependency identifier
    image: postgres:16 # Required: Docker image
    volumes: # Optional: Volume mounts
      - postgres_data:/var/lib/postgresql/data
    env: # Optional: Environment variables
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_USER=${POSTGRES_USER:-postgres}
      - POSTGRES_DB=${POSTGRES_DB:-app}
FieldTypeRequiredDescription
namestringYesUnique dependency identifier
imagestringYesDocker image to use
volumesarrayNoVolume mount definitions
envarrayNoEnvironment variable definitions

Volumes

Defines persistent storage volumes.

yaml
volumes:
  - postgres_data # Volume name

Each entry in the volumes array is a string representing the volume name. These volumes can be referenced in service and dependency configurations.

Environment Variables

The configuration file supports environment variable substitution in two formats:

  1. Required variables:

    yaml
    ${VARIABLE_NAME}
  2. Optional variables with defaults:

    yaml
    ${VARIABLE_NAME:-default_value}

Complete Example

yaml
project:
  name: my-project
  domain: my-project.example.com
  email: [email protected]

servers:
  - host: my-project.example.com
    port: 22
    user: my-project
    ssh_key: ~/.ssh/id_rsa

services:
  - name: my-app
    image: my-app:latest
    port: 80
    health_check:
      path: /
      interval: 10s
      timeout: 5s
      retries: 3
    routes:
      - path: /
        strip_prefix: false

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}

volumes:
  - postgres_data

Released under the MIT License.