Skip to content

Docker Deployment

wildfirebill edited this page Jul 20, 2026 · 1 revision

Docker Deployment

hub2lab is available as a Docker image on GitHub Container Registry.

Image

Registry Tag
ghcr.io/wildfirebill-docker/hub2lab latest, v0.1.0beta, sha-<commit>
docker pull ghcr.io/wildfirebill-docker/hub2lab:latest

Basic Docker Run

docker run -d \
  --name hub2lab \
  --restart unless-stopped \
  -p 3000:3000 \
  -v /opt/hub2lab/.env:/app/.env:ro \
  -v /opt/hub2lab/mapping.json:/app/mapping.json:ro \
  ghcr.io/wildfirebill-docker/hub2lab:latest

Volume Mounts

Host Path Container Path Purpose
/opt/hub2lab/.env /app/.env Environment variables (read-only)
/opt/hub2lab/mapping.json /app/mapping.json Sync mapping config (read-only)
/opt/hub2lab/logs /app/logs Persistent logs (optional)
/opt/hub2lab/mirrors /app/mirrors Git mirror cache (optional)

Docker Compose

Create docker-compose.yml:

version: '3.8'

services:
  hub2lab:
    image: ghcr.io/wildfirebill-docker/hub2lab:latest
    container_name: hub2lab
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - ./env:/app/.env:ro
      - ./mapping.json:/app/mapping.json:ro
      - ./logs:/app/logs
      - ./mirrors:/app/mirrors
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

Start with:

docker compose up -d

Reverse Proxy (HTTPS)

Caddy

hub2lab.example.com {
    reverse_proxy localhost:3000
}

Nginx

server {
    listen 443 ssl;
    server_name hub2lab.example.com;

    ssl_certificate /etc/ssl/certs/example.crt;
    ssl_certificate_key /etc/ssl/private/example.key;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Unraid Deployment

hub2lab includes a community app template for Unraid.

Automatic (Community Apps)

  1. Open Unraid web UI → Apps → search for "hub2lab"
  2. Click Install
  3. Configure the template with your tokens and mapping file path

Manual Template

The template file hub2lab.xml is included in the repository. To use it manually:

  1. Place hub2lab.xml in your Unraid flash drive at /boot/config/plugins/dockerMan/templates-user/
  2. In Unraid → Docker → Add Container → select the template from the dropdown

Unraid Template Configuration

Variable Description
Port Webhook server port (default: 3000, host mode recommended for host networking)
GITHUB_TOKEN GitHub PAT with repo scope (masked input)
GITHUB_WEBHOOK_SECRET GitHub webhook secret (masked input)
GITLAB_TOKEN GitLab PAT with api scope (masked input)
GITLAB_WEBHOOK_SECRET GitLab webhook secret (masked input)
GITLAB_BASE_URL GitLab instance URL (default: https://gitlab.com)
MAPPING_FILE Path to mapping.json (default: ./mapping.json)
SYNC_MARKER Loop prevention marker (default: [hub2lab])
LOG_LEVEL Log level: info, debug, warn, error
Config Path Path to mapping.json on the host
Mirrors Path Path to mirror cache directory on the host
Logs Path Path to log directory on the host

Environment Variables Reference

Variable Default Description
PORT 3000 HTTP server port
GITHUB_TOKEN (required) GitHub PAT with repo scope
GITHUB_WEBHOOK_SECRET (required) Secret for verifying GitHub webhook signatures
GITLAB_TOKEN (required) GitLab PAT with api scope
GITLAB_WEBHOOK_SECRET (required) Token for verifying GitLab webhook requests
GITLAB_BASE_URL https://gitlab.com GitLab instance URL
MAPPING_FILE ./mapping.json Path to mapping configuration
MIRROR_DIR ./mirrors Temp directory for git mirror operations
SYNC_MARKER [hub2lab] Marker string in commit messages to prevent loops
LOG_DIR ./logs Directory for log files
LOG_LEVEL info Log level (debug, info, warn, error)

Health Check

The Dockerfile exposes port 3000. The health endpoint is at /health.

curl http://localhost:3000/health
# {"status":"ok","timestamp":"2026-07-20T13:00:00.000Z"}

The docker-compose example above includes a built-in healthcheck using wget.

Clone this wiki locally