Skip to content

Deploy without Git

github-actions[bot] edited this page Oct 22, 2026 · 2 revisions

Deploy without Git

No git clone needed, and no build. Create two files and go:

1. Create .env with your secrets:

# Generate strong secrets:
#   MASTER_KEY:       openssl rand -base64 32
#   POSTGRES_PASSWORD: openssl rand -hex 16
#   ADMIN_TOKEN:      openssl rand -hex 16   (optional; auto-generated if empty)

MASTER_KEY=<your-master-key>
POSTGRES_PASSWORD=<your-postgres-password>
ADMIN_TOKEN=

# Optional: host port for the dashboard and API; change it if 8081 is taken
# HOST_PORT=8081

# Optional: WebAuthn/FIDO2 passkey login (only WEBAUTHN_RP_ID is required)
# WEBAUTHN_RP_ID=your-domain.com
# WEBAUTHN_RP_ORIGINS=https://your-domain.com

2. Create docker-compose.yml:

docker-compose.yml (click to expand, then copy)
name: model-hotel
services:
    app:
        # Build from source (default):
        build:
            context: .
            args:
                VERSION: ${VERSION:-dev}
                COMMIT: ${COMMIT:-unknown}
        # Prebuilt image: comment out build above, then uncomment one of these:
        # image: ghcr.io/hugalafutro/model-hotel:latest
        # image: hugalafutro/model-hotel:latest
        labels:
            app.group: model-hotel
        ports:
            - "${HOST_PORT:-8081}:8080"
        environment:
            - MASTER_KEY=${MASTER_KEY:?MASTER_KEY must be set in .env}
            - POSTGRES_USER=${POSTGRES_USER:-modelhotel}
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set in .env}
            - POSTGRES_HOST=db
            - POSTGRES_DB=${POSTGRES_DB:-modelhotel}
            - ADMIN_TOKEN=${ADMIN_TOKEN:-}
            - ALLOW_HTTP_PROVIDERS=false
            - ALLOW_EMBED=false
            - DATA_DIR=/data
            - RATE_LIMIT_ENABLED=true
            - DEBUG_LOG=false
            - CORS_ORIGINS=http://localhost:5173,http://localhost:${HOST_PORT:-8081}
            - WEBAUTHN_RP_ID=${WEBAUTHN_RP_ID:-}
            - WEBAUTHN_RP_ORIGINS=${WEBAUTHN_RP_ORIGINS:-}
            - ALLOWED_PROVIDER_HOSTS=
            - TRUSTED_PROXIES=
            - KNOWN_PROXIES=
        volumes:
            - ./.data:/data
            # Docker socket (disabled by default for security).
            # Enable to show per-container CPU and memory stats in the sidebar.
            # ⚠️  Socket access lets the container control the Docker daemon.
            #     Only enable if you trust the deployment environment.
            # - /var/run/docker.sock:/var/run/docker.sock:ro
        restart: unless-stopped
        # Model Hotel winds down in stages on SIGTERM. Worst case, in order:
        # 10s HTTP drain (open SSE tabs and proxied streams are ended first, so
        # this is usually quick) + 35s background join (the 30s ceiling of the
        # scheduled-disable sweep, which deliberately finishes the statement it
        # has already started, plus a 5s margin; the retention and stale-log
        # sweeps have no ceiling and the join cancels them instead of waiting)
        # + 10s audit drain (one record's 5s insert plus the 5s retention prune
        # it piggybacks) + 5s app-log writer stop + 5s OTLP flush = 65s. The
        # closes around them (the event bus, the proxy handler, discovery, the
        # docker client, the rate limiters and the database pool) carry no budget
        # of their own, so this is a ceiling with headroom over the 65s, not the
        # sum. Docker's default grace is 10s, which would SIGKILL partway through
        # the drain and take the audit rows and the last log lines with it.
        stop_grace_period: 75s
        depends_on:
            db:
                condition: service_healthy

    db:
        image: postgres:16-alpine
        labels:
            app.group: model-hotel
        command: ["postgres", "-c", "log_min_error_statement=panic",
                  "-c", "log_min_messages=error", "-c", "log_checkpoints=off"]
        environment:
            - POSTGRES_USER=${POSTGRES_USER:-modelhotel}
            - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set in .env}
            - POSTGRES_DB=${POSTGRES_DB:-modelhotel}
        volumes:
            - ./.data/pgdata:/var/lib/postgresql/data
        restart: unless-stopped
        healthcheck:
            test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-modelhotel}"]
            interval: 5s
            timeout: 5s
            retries: 5

    # Optional: outbound alerting via Apprise. Uncomment to run a stateless
    # apprise-api container, then in Settings β†’ Alerts switch alerting on and press
    # "Set up alerts": the wizard checks http://apprise:8000, builds the destination
    # URL for you (ntfy, Telegram, Discord, email, or a raw Apprise URL), tests it,
    # and saves only at Finish. The same fields sit under "Manual configuration
    # (advanced)" if you would rather paste tgram://<bot_token>/<chat_id>
    # yourself. Model Hotel POSTs event summaries here and Apprise fans them out
    # to your service. No request content is ever sent.
    # apprise:
    #     image: caronc/apprise:latest
    #     labels:
    #         app.group: model-hotel
    #     restart: unless-stopped
    #     # Not exposed to the host: only Model Hotel needs to reach it.
    #     expose:
    #         - "8000"

3. Switch to the prebuilt image. The file above builds from source, which needs the repository next to it, so in your copy comment out the build: block (the build: line and the four lines under it) and uncomment one of the two image: lines (GHCR or Docker Hub).

4. Deploy:

docker compose up -d

Then read the admin token from docker compose logs app and open http://localhost:8081 (or the HOST_PORT you set). The file sets name: model-hotel, so a second stack on the same host needs a different name: (or -p <other> on every compose command) and a different HOST_PORT.

Note

The docker-compose.yml content above is the production compose (auto-synced by a GitHub Action). See Development for the development override.

Note

WEBAUTHN_RP_ID enables FIDO2/WebAuthn passkey login (leave empty to disable); WEBAUTHN_RP_ORIGINS is optional and falls back to CORS_ORIGINS. TRUSTED_PROXIES is for trusting inbound X-Forwarded-For headers from reverse proxies (rate limiting/logging). KNOWN_PROXIES is for allowing outbound connections to internal LLM servers on private networks (bypasses SSRF protection). See Configuration for details.

Note

The app only sees the variables listed under its environment: key; .env just fills their ${...} placeholders. To use any other variable (for example COOKIE_SECURE, METRICS_TOKEN or LOG_FORMAT), add it to that list, e.g. - COOKIE_SECURE=${COOKIE_SECURE:-always}. COOKIE_SECURE sets the Secure attribute on the dashboard login cookies: always (the default) sends them only over HTTPS or to http://localhost, so logging in over plain HTTP from another machine (e.g. http://192.168.1.10:8081) fails until you set auto (follows the request: TLS or X-Forwarded-Proto: https) or never (plain-HTTP LAN).

To stop, update or remove the stack, see Stop, Update, Remove.

Navigation

Getting Started

Using

Operating

Reference


Quick Links

Clone this wiki locally