View RawView Code

5q12's Indexer - Docker Image

A PHP-Based file browser with sorting, filtering, download, icons and caching. Configurable indexing with intelligent configuration management and environment variable support.

Quick Start

# Create docker-compose.yml
cat > docker-compose.yml << EOF
services:
  5q12-indexer:
    image: 5q12/5q12-indexer:latest
    container_name: 5q12-indexer
    restart: unless-stopped
    ports:
      - "5012:5012"  # Access the indexer on port 5012
    environment:
      - TZ=Etc/UTC   # Set your timezone (optional)
    volumes:
      # Configuration directory - stores settings and cache
      - /example_host_path/config:/config
      
      # Files directory - mount your content here to index
      - /example_host_path/files:/files
EOF

# Start the indexer
docker compose up -d
Access at: http://localhost:5012 Important: Replace /example_host_path/ with your actual host directories. The /config volume persists settings and cache, while /files contains the content you want to browse.

What's Included

Supported Tags

Volumes

PathPurposeRequiredNotes
/configConfiguration, cache, and local resourcesYesAuto-managed, preserves user settings
/filesContent directory to browse and indexYesSupports dot folders/files

Environment Variables

Basic Configuration

VariableDefaultDescription
TZEtc/UTCContainer timezone

Main Settings

VariableDefaultDescription
INDEXER_ACCESS_URL""Base URL for generating absolute links
INDEXER_CACHE_TYPEsqliteCache type (sqlite or json)
INDEXER_ICON_TYPEdefaultIcon display (default, minimal, emoji, disabled)
INDEXER_DISABLE_FILE_DOWNLOADSfalseDisable individual file downloads
INDEXER_DISABLE_FOLDER_DOWNLOADSfalseDisable folder ZIP downloads
INDEXER_INDEX_HIDDENfalseIndex hidden files/folders (starting with .)
INDEXER_INDEX_ALLfalseIndex all files regardless of other settings
INDEXER_DENY_LIST""Comma-separated list of paths to deny
INDEXER_ALLOW_LIST""Comma-separated list of paths to allow

File Type Configuration

Configure indexing and viewing for any file type using these patterns: Examples:
environment:
  # Disable PHP file indexing and viewing
  - INDEXER_INDEX_FILETYPE_PHP=false
  - INDEXER_VIEW_FILETYPE_PHP=false
  
  # Enable JavaScript viewing but disable Markdown
  - INDEXER_VIEW_FILETYPE_JS=true
  - INDEXER_INDEX_FILETYPE_MD=false
  - INDEXER_VIEW_FILETYPE_MD=false
  
  # Configure image types
  - INDEXER_INDEX_FILETYPE_PNG=true
  - INDEXER_VIEW_FILETYPE_PNG=true

Port

The container exposes port 5012 for the web interface.

Configuration Management

The indexer features intelligent configuration management:

Example Configurations

Basic File Server

services:
  5q12-indexer:
    image: 5q12/5q12-indexer:latest
    container_name: file-server
    restart: unless-stopped
    ports:
      - "8080:5012"
    volumes:
      - ./config:/config
      - ./public-files:/files

Secure Document Server

services:
  5q12-indexer:
    image: 5q12/5q12-indexer:latest
    container_name: secure-docs
    restart: unless-stopped
    ports:
      - "5012:5012"
    environment:
      - TZ=America/New_York
      - INDEXER_ACCESS_URL=https://docs.example.com
      - INDEXER_ICON_TYPE=minimal
      - INDEXER_INDEX_HIDDEN=false
      - INDEXER_DENY_LIST=admin,logs,.git,private/*
      - INDEXER_INDEX_FILETYPE_PHP=false
      - INDEXER_INDEX_FILETYPE_SH=false
      - INDEXER_VIEW_FILETYPE_PDF=true
      - INDEXER_VIEW_FILETYPE_MD=true
    volumes:
      - ./config:/config
      - ./documents:/files:ro

Media Server with Restrictions

services:
  5q12-indexer:
    image: 5q12/5q12-indexer:latest
    container_name: media-server
    restart: unless-stopped
    ports:
      - "5012:5012"
    environment:
      - TZ=Etc/UTC
      - INDEXER_CACHE_TYPE=sqlite
      - INDEXER_DISABLE_FILE_DOWNLOADS=true
      - INDEXER_DISABLE_FOLDER_DOWNLOADS=true
      - INDEXER_INDEX_FILETYPE_MP4=true
      - INDEXER_VIEW_FILETYPE_MP4=true
      - INDEXER_INDEX_FILETYPE_MP3=true
      - INDEXER_VIEW_FILETYPE_MP3=true
      - INDEXER_INDEX_FILETYPE_JPG=true
      - INDEXER_VIEW_FILETYPE_JPG=true
    volumes:
      - ./config:/config
      - /mnt/media:/files:ro

Development Environment

services:
  5q12-indexer:
    image: 5q12/5q12-indexer:latest
    container_name: dev-files
    restart: unless-stopped
    ports:
      - "5012:5012"
    environment:
      - TZ=America/New_York
      - INDEXER_INDEX_HIDDEN=true
      - INDEXER_INDEX_ALL=false
      - INDEXER_ALLOW_LIST=src/*,docs/*,README.md
      - INDEXER_VIEW_FILETYPE_JS=true
      - INDEXER_VIEW_FILETYPE_TS=true
      - INDEXER_VIEW_FILETYPE_JSON=true
      - INDEXER_VIEW_FILETYPE_MD=true
      - INDEXER_INDEX_FILETYPE_PHP=true
      - INDEXER_VIEW_FILETYPE_PHP=false
    volumes:
      - ./config:/config
      - ./project:/files

Production Setup

services:
  5q12-indexer:
    image: 5q12/5q12-indexer:1.1.18  # Pin version
    container_name: 5q12-indexer-prod
    restart: unless-stopped
    ports:
      - "5012:5012"
    environment:
      - TZ=Etc/UTC
      - INDEXER_ACCESS_URL=https://files.example.com
      - INDEXER_CACHE_TYPE=sqlite
      - INDEXER_ICON_TYPE=default
      - INDEXER_INDEX_HIDDEN=false
      - INDEXER_DENY_LIST=.env,.git,admin,logs
    volumes:
      - indexer-config:/config
      - /srv/public:/files:ro
    deploy:
      resources:
        limits:
          memory: 512M
          cpus: '0.5'
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

volumes:
  indexer-config:

Manual Configuration

While environment variables are recommended, you can still manually edit config.json in the /config volume:
{
  "version": "1.1.18",
  "main": {
    "access_url": "",
    "cache_type": "sqlite",
    "icon_type": "default",
    "disable_file_downloads": false,
    "disable_folder_downloads": false,
    "index_hidden": false,
    "index_all": false,
    "deny_list": "",
    "allow_list": ""
  },
  "exclusions": {
    "index_folders": true,
    "index_non-descript-files": true,
    "index_php": false,
    "index_js": true
  },
  "viewable_files": {
    "view_non-descript-files": false,
    "view_php": false,
    "view_js": true
  }
}
Environment variables will override config.json settings on container startup.

Features

Security

Health Check

The container includes a built-in health check that verifies the web service is responding correctly.

Updates

# Pull latest image
docker compose pull

# Recreate container (preserves config automatically)
docker compose up -d

# Clean up old images
docker image prune
Your configuration will be automatically updated to support new features while preserving all your custom settings. Environment variables take precedence and are applied on every startup.

Migration from Earlier Versions

If upgrading from versions prior to 1.1.18:
  1. Your existing configuration will be automatically preserved
  2. New configuration fields will be added for enhanced functionality
  3. Consider migrating manual config.json edits to environment variables
  4. The system will log what changes were made during the update
  5. No manual intervention required

Troubleshooting

Permission Issues

# Fix config directory permissions
sudo chown -R 82:82 ./config

# Or use permissive permissions
chmod -R 755 ./config ./files

Container Logs

# View logs (includes config update details)
docker compose logs -f 5q12-indexer

# Check environment variable processing
docker compose logs 5q12-indexer | grep -E "(environment|override)"

Configuration Issues

# View startup logs to see config updates
docker compose logs 5q12-indexer | grep -E "(config|version|environment)"

# Check current config version
docker exec 5q12-indexer cat /config/config.json | grep version

# Verify environment variable processing
docker exec 5q12-indexer env | grep INDEXER_

Access Issues

# Test connectivity
curl -I http://localhost:5012

# Check port availability
netstat -tlnp | grep :5012

Links

Links (GitHub)