Skip to main content

Docker Deployment

Deploy EdgeFlow using Docker containers

Overview

Docker is the recommended way to deploy EdgeFlow in production. It provides isolation, easy updates, and consistent environments across different systems.

Quick Start

Run EdgeFlow with a single command:

docker run -d \
  --name edgeflow \
  -p 8080:8080 \
  -v edgeflow-data:/data \
  edgeflow/edgeflow:latest

Access the web UI at http://localhost:8080

Docker Compose

For production deployments, use Docker Compose:

# docker-compose.yml
version: '3.8'

services:
  edgeflow:
    image: edgeflow/edgeflow:latest
    container_name: edgeflow
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - edgeflow-data:/data
      - ./config:/app/configs
    environment:
      - EDGEFLOW_SERVER_PORT=8080
      - EDGEFLOW_LOGGER_LEVEL=info
      - EDGEFLOW_DATABASE_PATH=/data/edgeflow.db
    # For GPIO access on Raspberry Pi
    privileged: true
    devices:
      - /dev/gpiomem:/dev/gpiomem

volumes:
  edgeflow-data:

Start with:

docker-compose up -d

Environment Variables

Variable Default Description
EDGEFLOW_SERVER_PORT8080HTTP server port
EDGEFLOW_LOGGER_LEVELinfoLog level (debug, info, warn, error)
EDGEFLOW_DATABASE_PATH/data/edgeflow.dbSQLite database path
EDGEFLOW_AUTH_ENABLEDfalseEnable authentication
EDGEFLOW_AUTH_SECRET-JWT secret key

Raspberry Pi GPIO Access

To access GPIO pins from Docker on Raspberry Pi:

docker run -d \
  --name edgeflow \
  --privileged \
  --device /dev/gpiomem \
  --device /dev/i2c-1 \
  -p 8080:8080 \
  -v edgeflow-data:/data \
  edgeflow/edgeflow:latest

Data Persistence

EdgeFlow stores data in the /data directory inside the container:

  • /data/edgeflow.db - SQLite database with flows and settings
  • /data/flows/ - Flow JSON files
  • /data/credentials/ - Encrypted credentials

Always mount a volume to persist this data:

-v edgeflow-data:/data

Updating

To update EdgeFlow to the latest version:

# Pull the latest image
docker pull edgeflow/edgeflow:latest

# Stop and remove the old container
docker stop edgeflow
docker rm edgeflow

# Start with the new image
docker run -d \
  --name edgeflow \
  -p 8080:8080 \
  -v edgeflow-data:/data \
  edgeflow/edgeflow:latest

Or with Docker Compose:

docker-compose pull
docker-compose up -d

Resource Limits

For IoT devices with limited resources, set memory limits:

docker run -d \
  --name edgeflow \
  --memory="256m" \
  --memory-swap="512m" \
  -p 8080:8080 \
  -v edgeflow-data:/data \
  edgeflow/edgeflow:latest

Health Checks

EdgeFlow provides a health endpoint for container orchestration:

curl http://localhost:8080/api/v1/health

Add to Docker Compose:

healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/health"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 10s