[Go to site: main page, start]

Skip to content

Docker Compose ​

Puppetflow provides a self-contained production stack based on published images.

Production ​

The following configuration runs Puppetflow from published container images.

  • PostgreSQL stores application state.
  • An ephemeral Redis service coordinates live browser streams.
  • Pinokio provides Chromium.
  • The stream server provides live browser viewing.

Start from the minimal .env, then switch its database block to PostgreSQL as described below.

yaml
services:
  # App (nginx + php-fpm via supervisor)
  app:
    image: ghcr.io/puppetflow/puppetflow:latest
    pull_policy: always
    restart: unless-stopped
    ports:
      - "8000:8000"
    volumes:
      - puppetflow-framework:/app/storage
      - puppetflow-uploads:/app/data/storage
      - puppetflow-execution:/app/data/execution
    env_file:
      - .env
    depends_on:
      pinokio:
        condition: service_started
      stream-server:
        condition: service_started
      postgres:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:8000/up"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s

  # Queue index 1 workers
  queue-1:
    image: ghcr.io/puppetflow/puppetflow:latest
    pull_policy: always
    restart: unless-stopped
    command: ["php", "artisan", "queue:work", "--queue=1", "--tries=1", "--timeout=630", "--sleep=3", "--max-jobs=500", "--max-time=3600"]
    deploy:
      replicas: 2
    volumes:
      - puppetflow-framework:/app/storage
      - puppetflow-uploads:/app/data/storage
      - puppetflow-execution:/app/data/execution
    env_file:
      - .env
    environment:
      BROWSER_STREAM_INTERNAL_URL: "http://stream-server:6080"
      RUNNER_API_INTERNAL_URL: "http://app:8000/api/internal/runner"
    depends_on:
      postgres:
        condition: service_healthy
      stream-server:
        condition: service_started

  # Queue index 2 worker
  queue-2:
    image: ghcr.io/puppetflow/puppetflow:latest
    pull_policy: always
    restart: unless-stopped
    command: ["php", "artisan", "queue:work", "--queue=2", "--tries=1", "--timeout=630", "--sleep=3", "--max-jobs=500", "--max-time=3600"]
    deploy:
      replicas: 1
    volumes:
      - puppetflow-framework:/app/storage
      - puppetflow-uploads:/app/data/storage
      - puppetflow-execution:/app/data/execution
    env_file:
      - .env
    environment:
      BROWSER_STREAM_INTERNAL_URL: "http://stream-server:6080"
      RUNNER_API_INTERNAL_URL: "http://app:8000/api/internal/runner"
    depends_on:
      postgres:
        condition: service_healthy
      stream-server:
        condition: service_started

  # Scheduler
  scheduler:
    image: ghcr.io/puppetflow/puppetflow:latest
    pull_policy: always
    restart: unless-stopped
    command: ["php", "artisan", "schedule:work"]
    volumes:
      - puppetflow-framework:/app/storage
      - puppetflow-uploads:/app/data/storage
      - puppetflow-execution:/app/data/execution
    env_file:
      - .env
    depends_on:
      postgres:
        condition: service_healthy

  # Incoming mailbox SMTP server
  mailbox-smtp:
    image: ghcr.io/puppetflow/puppetflow:latest
    pull_policy: always
    restart: unless-stopped
    command: ["php", "artisan", "mailbox:serve", "--port=2525"]
    ports:
      - "${MAILBOX_SMTP_PORT:-2525}:2525"
    volumes:
      - puppetflow-framework:/app/storage
      - puppetflow-uploads:/app/data/storage
      - puppetflow-execution:/app/data/execution
    env_file:
      - .env
    depends_on:
      postgres:
        condition: service_healthy

  # Browser stream server
  stream-server:
    image: ghcr.io/puppetflow/puppetflow-stream-server:latest
    pull_policy: always
    restart: unless-stopped
    stop_grace_period: 30s
    ports:
      - "${BROWSER_STREAM_BIND_ADDRESS:-0.0.0.0}:${BROWSER_STREAM_PUBLIC_PORT:-6080}:6080"
    env_file:
      - .env
    depends_on:
      redis:
        condition: service_healthy

  # Create the execution subdirectory before mounting it
  init-volumes:
    image: busybox
    volumes:
      - puppetflow-uploads:/uploads
      - puppetflow-execution:/execution
    command: ["sh", "-c", "chown -R 33:33 /uploads /execution"]
    restart: "no"

  # Pinokio browser gateway
  pinokio:
    image: ghcr.io/puppetflow/pinokio:latest
    pull_policy: always
    restart: unless-stopped
    shm_size: "1gb"
    depends_on:
      init-volumes:
        condition: service_completed_successfully
    volumes:
      - puppetflow-execution:/app/data/execution
      - pinokio-downloads:/opt/browsers
    environment:
      TOKEN: "${PINOKIO_TOKEN:-}"
      BROWSER_ARCHIVE_URL: "${PINOKIO_BROWSER_ARCHIVE_URL:-}"
      CHROME_EXTRA_ARGS: "${PINOKIO_CHROME_EXTRA_ARGS:-}"

  # PostgreSQL
  postgres:
    image: postgres:17-alpine
    restart: unless-stopped
    volumes:
      - puppetflow-db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: "${DB_DATABASE:-puppetflow}"
      POSTGRES_USER: "${DB_USERNAME:-puppetflow}"
      POSTGRES_PASSWORD: "${DB_PASSWORD:?DB_PASSWORD must be configured}"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
      interval: 5s
      timeout: 5s
      retries: 5

  # Redis
  redis:
    image: redis:8-alpine
    restart: unless-stopped
    command:
      - /bin/sh
      - -ec
      - |
        if [ -n "$${REDIS_PASSWORD:-}" ] && [ "$${REDIS_PASSWORD}" != "null" ]; then
          exec redis-server --save "" --appendonly no --requirepass "$${REDIS_PASSWORD}"
        fi
        exec redis-server --save "" --appendonly no
    environment:
      REDIS_PASSWORD: "${REDIS_PASSWORD:-}"
    healthcheck:
      test: ["CMD-SHELL", "if [ -n \"$$REDIS_PASSWORD\" ] && [ \"$$REDIS_PASSWORD\" != \"null\" ]; then redis-cli --no-auth-warning -a \"$$REDIS_PASSWORD\" ping; else redis-cli ping; fi"]
      interval: 5s
      timeout: 3s
      retries: 5

volumes:
  puppetflow-framework:
  puppetflow-uploads:
  puppetflow-execution:
  puppetflow-db:
  pinokio-downloads:

The bundled Redis service has no persistence or volume. Use it only for transient browser stream coordination.

Queues, cache, locks, and sessions remain in PostgreSQL by default. If you move them to Redis, use an external deployment with persistence and backups.

Prerequisites ​

  • Docker Engine and Docker Compose v2.
  • A minimal .env next to the Compose file, switched to the documented PostgreSQL block, with APP_KEY, DB_PASSWORD, and BROWSER_STREAM_SECRET configured. Its APP_QUEUES_COUNTER=2 setting matches the two queue indexes in this stack.

Nothing else is required for a local installation. PostgreSQL, the ephemeral browser-stream Redis broker, Pinokio, storage, and networking are created by Docker Compose.

For a public deployment, configure HTTPS, set APP_URL to the public application origin, set BROWSER_STREAM_PUBLIC_URL to the public stream origin, and set BROWSER_STREAM_ALLOWED_ORIGINS to the application origin.

Starting and updating ​

bash
docker compose pull
docker compose up -d

Volumes ​

  • puppetflow-framework - Framework state, logs, cache, and generated application files.
  • puppetflow-uploads - Durable application uploads and completed run artifacts when using local storage.
  • puppetflow-execution - Temporary run workspace shared with the browser service.
  • puppetflow-db - PostgreSQL data.
  • pinokio-downloads - Browser archives downloaded by Pinokio when PINOKIO_BROWSER_ARCHIVE_URL is set. Stays empty otherwise. Remove it to force a fresh download.

Networking ​

Published ports:

  • 8000: application
  • 6080: browser stream
  • 2525: incoming SMTP

Put a reverse proxy in front of ports 8000 and 6080 for HTTPS. Override the stream address and port with BROWSER_STREAM_BIND_ADDRESS and BROWSER_STREAM_PUBLIC_PORT.

Scaling ​

Each queue index from 1 through APP_QUEUES_COUNTER must have a matching worker service. To add replicas to an existing index:

bash
docker compose up -d --scale queue-1=3

To add another index, increase APP_QUEUES_COUNTER, add a queue-N service running --queue=N, and restart the application. Each worker processes one flow at a time. Scale based on your concurrency needs and available RAM (each Chromium session uses ~200-500 MB).