Skip to content

Configuration

PLift uses a Salt Stack container to generate all Docker Compose files and application configurations from YAML pillar files.

Architecture

configs/              # Configuration files (Salt pillars)
  ├── base/           # Base container configs (Salt)
  ├── services/       # Service configs (MySQL, Redis, etc.)
  ├── tools/          # Tool configs (Prometheus, Grafana, etc.)
  ├── apps/           # Application framework defaults
  ├── databases/      # Database user and permission configs
  └── main/conf       # Active configuration (grains)

salt/actions/         # Salt states and templates
  └── generate/       # Generation logic
      ├── apps_configs.sls
      ├── services_configs.sls
      ├── tools_configs.sls
      ├── migrations.sls
      └── templates/  # Jinja2 templates

generated_configs/    # Auto-generated files
  ├── docker/         # Generated docker-compose files
  ├── haproxy/        # HAProxy configuration
  ├── prometheus/     # Prometheus configuration
  ├── grafana/        # Grafana datasources and dashboards
  ├── ssl/            # SSL certificates
  └── migrations/     # Database migration scripts

Managing Services

Enable/disable services by editing configs/main/conf or using CLI:

# List enabled services
plift get-services

# Add a service
plift add-service s=redis

# Remove a service
plift remove-service s=redis

Managing Tools

# List enabled tools
plift get-tools

# Add a tool (e.g., Prometheus)
plift add-tool t=prometheus

# Remove a tool
plift remove-tool t=prometheus

Configuration Generation

Generate specific configuration types:

# Generate all configs
plift generate-all

# Generate specific configs
plift generate c=default    # Base configs (hosts file, etc.)
plift generate c=services   # Service configs
plift generate c=tools      # Tool configs
plift generate c=apps       # Application configs
plift generate c=grafana    # Grafana dashboards and datasources

Viewing Configuration

# Get all configuration values
plift get-config

# Get specific config value
plift get-config VAL=apps OUT=yaml

Environment Variables

Key environment variables in .env file:

LOCAL_DOMAIN (Required)

Domain suffix for all services. Default: plift.local

Used to generate: - All service URLs (e.g., grafana.plift.local) - SSL certificate wildcards (*.plift.local) - HAProxy routing rules - Application hostnames - Hosts file entries

Must be set before running plift generate-all.

Other Variables

Variable Description Default
SALT_IMAGE Salt container image name -
LOG_LEVEL Salt execution log level error

Application Frameworks

PLift supports multiple frameworks with pre-configured templates:

Framework Language Features
Laravel PHP PHP-FPM, auto .env generation, Composer
Symfony PHP PHP-FPM, similar to Laravel
Django Python Gunicorn, auto settings generation
Express/Fastify Node.js Nodemon hot reload, OpenTelemetry
Spring Boot Java Maven/Gradle, Actuator, OpenTelemetry agent

Adding a Laravel App

Edit configs/apps/init.sls:

plift:
  apps:
    laravel:
      my_laravel_app:
        lb_url: 'my-laravel-app.plift.local'
        monitoring:
          prometheus:
            enabled: true
            port: 8000
            path: /metrics
          apm:
            enabled: true
            type: opentelemetry
            tempo_endpoint: http://tempo:4318
        docker:
          name: my_laravel_app
          hostname: my_laravel_app
          exposed_port: 8000
          port_bindings:
            - "8000:8000"
          volumes:
            - "../../apps/my_laravel_app:/var/www/html"
        app_config:
          db_name: my_laravel_app
          db_user: my_laravel_app
          db_password: my_laravel_app_pass
          db_host: mysql
          db_port: 3306

Then generate and start:

plift generate c=apps
plift migrate-databases
plift start-apps

Customizing Configurations

All configurations are in configs/ directory. Edit the YAML files and regenerate:

# Edit configs/services/init.sls to modify service settings
# Edit configs/tools/init.sls to modify tool settings
# Edit configs/apps/init.sls to modify app settings

# Regenerate after changes
plift generate c=services  # or tools, apps, etc.

Hot Reloading

All frameworks support hot reloading in development:

Framework Method
Laravel PHP built-in server with file watching
Django Django development server with auto-reload
Node.js Nodemon for automatic restarts
Java Spring Boot DevTools (if configured)

Changes to application code are automatically reflected without container restart.