This guide explains how to use YAML configuration files when running ZephyrGate with Docker Compose.
Yes, you can absolutely use YAML config files with Docker Compose! Here's where to put them:
Place your configuration files in the ./config directory (relative to your docker-compose.yml file):
your-project/
├── docker-compose.yml
├── config/ ← Put your YAML configs here
│ ├── config.yaml ← Main configuration file
│ ├── production.yaml ← Environment-specific config
│ ├── local.yaml ← Local overrides
│ └── default.yaml ← Default settings
├── data/ ← Database and app data
├── logs/ ← Log files
└── ...
The Docker Compose file mounts the config directory as:
volumes:
- zephyr_config:/app/config
Where zephyr_config is defined as:
zephyr_config:
driver: local
driver_opts:
type: none
o: bind
device: ${CONFIG_DIR:-./config} # Defaults to ./config
# Create config directory
mkdir -p config
# Copy example and customize
cp config/config-example.yaml config/config.yaml
# Edit config/config.yaml with your settings
# Start with Docker Compose
docker-compose up -d
You can specify a different config directory using environment variables:
# Set custom config directory
export CONFIG_DIR=/path/to/your/config
# Or use .env file
echo "CONFIG_DIR=/path/to/your/config" >> .env
# Start services
docker-compose up -d
ZephyrGate supports hierarchical configuration loading:
config/
├── default.yaml # Base configuration
├── production.yaml # Production overrides
├── development.yaml # Development overrides
└── local.yaml # Local user overrides (highest priority)
# Create the config directory
mkdir -p config
# Copy the example
cp config/config-example.yaml config/config.yaml
# Edit your configuration
nano config/config.yaml # or use your preferred editor
Meshtastic Interface:
meshtastic:
interfaces:
- type: "serial"
port: "/dev/ttyUSB0" # This will be available inside the container
baud_rate: 921600
name: "Primary Radio"
Services to Enable:
services:
emergency:
enabled: true
responders: ["!12345678"] # Add your responder node IDs
weather:
enabled: true
default_location:
latitude: 40.7128 # Set your location
longitude: -74.0060
web:
enabled: true
auth:
default_password: "YourSecurePassword" # Change this!
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f zephyrgate
# Check status
docker-compose ps
Here's a complete example config/config.yaml for Docker Compose deployment:
# ZephyrGate Docker Compose Configuration
app:
name: "ZephyrGate"
debug: false
log_level: "INFO"
# Configure your Meshtastic interfaces
meshtastic:
interfaces:
# Serial interface (most common)
- type: "serial"
port: "/dev/ttyUSB0" # Adjust for your system
baud_rate: 921600
name: "Primary Radio"
# TCP interface example (for WiFi-enabled devices)
# - type: "tcp"
# host: "192.168.1.100"
# port: 4403
# name: "WiFi Radio"
# Database location (inside container)
database:
path: "data/zephyrgate.db"
# Enable/disable services as needed
services:
bbs:
enabled: true
emergency:
enabled: true
responders: ["!12345678", "!87654321"] # Add your responder node IDs
escalation_timeout: 1800 # 30 minutes
bot:
enabled: true
auto_response: true
new_node_greeting: true
weather:
enabled: true
default_location:
latitude: 40.7128 # Set your coordinates
longitude: -74.0060
alerts:
fema_ipaws: true
noaa_weather: true
usgs_earthquake: true
# Email gateway (optional - requires email server setup)
email:
enabled: false
smtp:
host: "smtp.gmail.com"
port: 587
username: "your-email@gmail.com"
password: "your-app-password"
web:
enabled: true
port: 8080
auth:
default_username: "admin"
default_password: "CHANGE_THIS_PASSWORD" # IMPORTANT: Change this!
# Security settings
security:
trusted_nodes: []
admin_nodes: ["!12345678"] # Add admin node IDs
rate_limiting:
enabled: true
max_requests_per_minute: 60
# Logging
logging:
level: "INFO"
file: "logs/zephyrgate.log"
console: true
You can also override config values using environment variables in your .env file:
# .env file
ZEPHYR_LOG_LEVEL=DEBUG
ZEPHYR_WEB_PORT=8080
ZEPHYR_DEBUG=true
CONFIG_DIR=./config
DATA_DIR=./data
LOG_DIR=./logs
ZephyrGate loads configuration in this order (later files override earlier ones):
config/default.yaml(built-in defaults)config/production.yaml(environment-specific)config/local.yaml(local overrides)- Environment variables (
ZEPHYR_*)
For production deployment, create a config/production.yaml:
app:
debug: false
log_level: "WARNING"
security:
rate_limiting:
enabled: true
max_requests_per_minute: 30
services:
web:
auth:
default_password: "VerySecureProductionPassword"
logging:
level: "WARNING"
console: false # Only log to file in production
# Start services in background
docker-compose up -d
# View logs
docker-compose logs -f zephyrgate
# Stop services
docker-compose down
# Restart a specific service
docker-compose restart zephyrgate
# Update and restart
docker-compose pull && docker-compose up -d
# View service status
docker-compose ps
# Execute commands in container
docker-compose exec zephyrgate bash
- Ensure config files are in the
./configdirectory - Check file permissions (should be readable)
- Verify YAML syntax with
yamllint config/config.yaml
- Ensure your Meshtastic device is connected to
/dev/ttyUSB0(or adjust path) - Check that the device is accessible:
ls -la /dev/ttyUSB* - Verify the device path in your config matches the actual device
- Ensure the config directory is readable:
chmod -R 755 config/ - Check that data and logs directories are writable:
chmod -R 755 data/ logs/
- Verify the port mapping in docker-compose.yml matches your config
- Check firewall settings
- Ensure the web service is enabled in your config
- Change Default Passwords: Always change the default web interface password
- Limit Admin Access: Only add trusted node IDs to
admin_nodes - Use HTTPS: In production, use the nginx proxy with SSL certificates
- Regular Updates: Keep Docker images updated with
docker-compose pull
The configuration files will be automatically loaded by the application when it starts in the Docker container!