Configuration Overview
FTL uses a single YAML configuration file (ftl.yaml
) to define your entire deployment setup. This file describes your project settings, server configurations, services, dependencies, and volumes.
Configuration File Structure
The ftl.yaml
file is organized into these main sections:
- Project: Basic project information like name, domain, and contact details
- Servers: Target server specifications and SSH connection details
- Services: Your application services that will be deployed
- Dependencies: Supporting services like databases and caches
- Volumes: Persistent storage definitions
Basic Example
yaml
project:
name: my-project
domain: my-project.example.com
email: [email protected]
servers:
- host: my-project.example.com
port: 22
user: deploy
ssh_key: ~/.ssh/id_rsa
services:
- name: web
build:
context: .
dockerfile: Dockerfile
port: 3000
routes:
- path: /
Environment Variables
FTL supports environment variable substitution in your configuration:
- Required variables:
${VAR_NAME}
- Optional variables with defaults:
${VAR_NAME:-default_value}
Detailed Configuration
Each section of the configuration has its own detailed documentation:
- Project Settings - Core project configuration
- Server Configuration - Server and SSH settings
- Services - Application service definitions
- Dependencies - Supporting service configuration
- Volumes - Persistent storage management
Configuration Validation
FTL validates your configuration file before executing any commands. Common validation checks include:
- Required fields presence
- Port number validity
- File path existence
- Environment variable resolution
- Service name uniqueness
- Volume reference validity
Best Practices
- Version Control: Always keep your
ftl.yaml
in version control - Environment Variables: Use environment variables for sensitive data
- Health Checks: Define health checks for all services
- Documentation: Comment complex configurations
- Validation: Run
ftl validate
before deployments
Next Steps
- Learn about Project Settings
- Configure your Services
- Set up Dependencies
- Manage Volumes