Configuration Reference
Asantiya uses a YAML configuration file called deploy.yaml to define your deployment settings. This file should be placed in the root directory of your project.
Configuration File Structure
Here’s a complete example of a deploy.yaml configuration file:
# Main application configuration
service: my-awesome-app
image: my-awesome-app-image
app_ports: 8080:80
host: false
 
# Builder configuration
builder:
  arch: amd64
  local: true
  remote: ssh://user@server
  dockerfile: Dockerfile
  build_args:
    NODE_ENV: production
 
# Accessories (additional services)
accessories:
  postgres:
    service: my-awesome-app-db
    image: postgres:13
    ports: 5432:5432
    env:
      POSTGRES_PASSWORD: secret
      POSTGRES_DB: myapp
    volumes:
      - db_data:/var/lib/postgresql/data
    network: my-app-network
    depends_on: []
    options:
      restart: alwaysCore Configuration Options
Main Application Settings
| Option | Type | Description | Example | 
|---|---|---|---|
| service | string | Application name | my-app | 
| image | string | Docker image name | my-app:latest | 
| app_ports | string | Port mapping | 8080:80 | 
| host | boolean | Host machine config | false | 
Service Name
The service field defines the name of your application service. This name is used as the container name and for service identification.
service: myappBest Practices:
- Use lowercase letters, numbers, and hyphens only
- Keep it descriptive but concise
- Avoid special characters and spaces
Image Name
The image field specifies the Docker image name that will be built and used for your application.
image: my-app-imageBest Practices:
- Use descriptive names that reflect your application
- Consider including version tags for production deployments
- Follow Docker naming conventions
Port Mapping
The app_ports field maps host ports to container ports.
# Map host port 8080 to container port 80
app_ports: "8080:80"Common Port Mappings:
- Web applications: "8080:80"or"8080:3000"
- API services: "8080:8000"
- Database: "5432:5432"(PostgreSQL)
Host Configuration
The host field determines if the application runs on the host machine or in a container.
host: false  # Run in container (default)
host: true   # Run on host machineAdvanced Configuration
Builder Options
Configure how your Docker image is built. See Builders for detailed information.
builder:
  local: true          # Use local Docker daemon
  arch: amd64          # Target architecture
  dockerfile: Dockerfile.production
  remote: ssh://docker@builder-serverAccessories
Define additional services like databases, caches, and message queues. See Accessories for detailed information.
accessories:
  postgres:
    service: postgres
    image: postgres:15-alpine
    port: "5432:5432"
    env:
      - POSTGRES_DB=myapp
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=password
    volumes:
      - postgres_data:/var/lib/postgresql/data
    options:
      restart: alwaysNext Steps
- Builders - Learn about build configurations
- Accessories - Add databases and other services
- Environment Variables - Manage configuration securely
- Examples - See real-world configuration examples