Back to Onyx

Onyx Configuration

Custom Docker Setup & Scripts

🔧 Custom Configuration Overview

To avoid port conflicts and maintain a clean development environment, I created a custom configuration setup for Onyx with the following key features:

📁 Configuration Location

All custom configs stored at:

~/Projects/onyx-custom-config/

🔗 Why Symlinked & Versioned?

  • • Keep custom configs separate from Onyx repo
  • • Easy updates without modifying core Onyx
  • • Version control for configuration changes
  • • Quick switching between environments

🐳 docker-compose.custom-ports.yml

Custom port configuration to avoid conflicts with existing services:

# Custom port configuration for Onyx
# This file extends docker-compose.dev.yml with custom ports to avoid conflicts

services:
  # Override nginx to use port 5050 instead of 80
  nginx:
    ports: !override
      - "5050:80"  # Main web interface: http://localhost:5050

  # API server with custom port mapping
  api_server:
    ports:
      - "5008:8080"  # API endpoint: http://localhost:5008
    environment:
      - AUTH_TYPE=disabled  # For local development
      # For SSO integration, use:
      # - AUTH_TYPE=saml
      # - SAML_IDP_METADATA_URL=${SSO_METADATA_URL}

  # PostgreSQL with custom port to avoid 5432 conflict
  relational_db:
    ports:
      - "5433:5432"  # PostgreSQL: localhost:5433

  # Redis with custom port to avoid 6379 conflict
  cache:
    ports:
      - "5379:6379"  # Redis: localhost:5379

  # Vespa index with custom port
  index:
    ports:
      - "5019:19071"  # Vespa: http://localhost:5019

🔗 Symlink Strategy

Created symlinks from Onyx deployment directory to custom config:

ln -s ~/Projects/onyx-custom-config/start.sh ~/Projects/onyx/deployment/docker_compose/start-onyx.sh

This allows running scripts from either directory while maintaining version control.

📦 Version Control Benefits

  • Track configuration changes over time
  • Easy rollback if something breaks
  • Share configs across team/environments
  • Document why specific ports were chosen