|
| 1 | +# ============================================================================= |
| 2 | +# LibreDB Studio — Ready-to-use Docker Compose |
| 3 | +# ============================================================================= |
| 4 | +# Pulls the published image (ghcr.io/libredb/libredb-studio:latest) — no source |
| 5 | +# build required. Works on any Docker host and PaaS that consumes a plain |
| 6 | +# docker-compose.yml (Dokploy, Coolify, Portainer, etc.). |
| 7 | +# |
| 8 | +# Quick start: |
| 9 | +# 1. cp docker-compose.example.yml docker-compose.yml |
| 10 | +# 2. cp .env.example .env # then set at least JWT_SECRET / passwords |
| 11 | +# 3. docker compose up -d |
| 12 | +# 4. open http://localhost:3000 |
| 13 | +# |
| 14 | +# Every supported environment variable is listed below. Commonly-used ones are |
| 15 | +# active; less-frequently-used ones are shown commented out — uncomment as needed. |
| 16 | +# Secrets are read from the .env file via ${VAR} interpolation and are never |
| 17 | +# hardcoded in this file. |
| 18 | +# ============================================================================= |
| 19 | + |
| 20 | +services: |
| 21 | + libredb-studio: |
| 22 | + image: ghcr.io/libredb/libredb-studio:latest |
| 23 | + container_name: libredb-studio |
| 24 | + restart: unless-stopped |
| 25 | + ports: |
| 26 | + - "3000:3000" |
| 27 | + # Uncomment if you enable the bundled PostgreSQL service below: |
| 28 | + # depends_on: |
| 29 | + # libredb-postgres: |
| 30 | + # condition: service_healthy |
| 31 | + environment: |
| 32 | + # ----------------------------------------------------------------------- |
| 33 | + # AUTHENTICATION (required) |
| 34 | + # ----------------------------------------------------------------------- |
| 35 | + ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@libredb.org} # admin: full access + maintenance tools |
| 36 | + ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env} |
| 37 | + USER_EMAIL: ${USER_EMAIL:-user@libredb.org} # user: query execution only |
| 38 | + USER_PASSWORD: ${USER_PASSWORD:?set USER_PASSWORD in .env} |
| 39 | + # JWT signing secret — min 32 chars. Generate: openssl rand -base64 32 |
| 40 | + JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET in .env (min 32 chars)} |
| 41 | + |
| 42 | + # Auth provider: "local" (default, email/password) or "oidc" (SSO) |
| 43 | + NEXT_PUBLIC_AUTH_PROVIDER: ${NEXT_PUBLIC_AUTH_PROVIDER:-local} |
| 44 | + |
| 45 | + # ----------------------------------------------------------------------- |
| 46 | + # OIDC SSO (only when NEXT_PUBLIC_AUTH_PROVIDER=oidc) |
| 47 | + # Auth0 / Keycloak / Okta / Azure AD / Zitadel |
| 48 | + # ----------------------------------------------------------------------- |
| 49 | + # OIDC_ISSUER: ${OIDC_ISSUER} # must serve /.well-known/openid-configuration |
| 50 | + # OIDC_CLIENT_ID: ${OIDC_CLIENT_ID} |
| 51 | + # OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET} |
| 52 | + # OIDC_SCOPE: ${OIDC_SCOPE:-openid profile email} |
| 53 | + # OIDC_ROLE_CLAIM: ${OIDC_ROLE_CLAIM:-} # e.g. realm_access.roles (Keycloak), groups (Okta) |
| 54 | + # OIDC_ADMIN_ROLES: ${OIDC_ADMIN_ROLES:-admin} |
| 55 | + |
| 56 | + # ----------------------------------------------------------------------- |
| 57 | + # STORAGE — where connections/config are persisted (server-side) |
| 58 | + # "local" (default) browser localStorage, zero config |
| 59 | + # "sqlite" server file, single-node persistent (uncomment volume below) |
| 60 | + # "postgres" multi-node persistent (uncomment the postgres service below) |
| 61 | + # ----------------------------------------------------------------------- |
| 62 | + STORAGE_PROVIDER: ${STORAGE_PROVIDER:-local} |
| 63 | + # STORAGE_SQLITE_PATH: ${STORAGE_SQLITE_PATH:-/app/data/libredb-storage.db} |
| 64 | + # STORAGE_POSTGRES_URL: ${STORAGE_POSTGRES_URL:-postgresql://postgres:postgres@libredb-postgres:5432/libredb_storage?sslmode=disable} |
| 65 | + |
| 66 | + # ----------------------------------------------------------------------- |
| 67 | + # AI / LLM (optional) — provider: gemini | openai | ollama | custom |
| 68 | + # ----------------------------------------------------------------------- |
| 69 | + # LLM_PROVIDER: ${LLM_PROVIDER:-gemini} |
| 70 | + # LLM_API_KEY: ${LLM_API_KEY} # required for gemini/openai |
| 71 | + # LLM_MODEL: ${LLM_MODEL:-gemini-2.5-flash} |
| 72 | + # LLM_API_URL: ${LLM_API_URL} # ollama/custom only, e.g. http://host:11434/v1 |
| 73 | + |
| 74 | + # ----------------------------------------------------------------------- |
| 75 | + # SEED CONNECTIONS (optional) — pre-configure databases on boot. |
| 76 | + # Uncomment the seed volume mount below, then provide seed-connections.yaml. |
| 77 | + # Credentials referenced in that file via ${VAR} are read from this .env. |
| 78 | + # ----------------------------------------------------------------------- |
| 79 | + # SEED_CONFIG_PATH: /app/config/seed-connections.yaml |
| 80 | + # SEED_CACHE_TTL_MS: ${SEED_CACHE_TTL_MS:-60000} |
| 81 | + |
| 82 | + # volumes: |
| 83 | + # # SQLite storage persistence (STORAGE_PROVIDER=sqlite): |
| 84 | + # - libredb-data:/app/data |
| 85 | + # # Seed connections file (read-only): |
| 86 | + # - ./seed-connections.yaml:/app/config/seed-connections.yaml:ro |
| 87 | + |
| 88 | + # Image runs as node:20-slim (no curl/wget) — use Node's built-in fetch. |
| 89 | + healthcheck: |
| 90 | + test: ["CMD", "node", "-e", "fetch('http://localhost:3000/api/db/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"] |
| 91 | + interval: 30s |
| 92 | + timeout: 5s |
| 93 | + retries: 3 |
| 94 | + start_period: 20s |
| 95 | + |
| 96 | + # --------------------------------------------------------------------------- |
| 97 | + # Optional: PostgreSQL backend for STORAGE_PROVIDER=postgres |
| 98 | + # To enable: uncomment this service, the STORAGE_POSTGRES_URL env above, |
| 99 | + # the depends_on block above, and the pgdata volume below. |
| 100 | + # --------------------------------------------------------------------------- |
| 101 | + # libredb-postgres: |
| 102 | + # image: postgres:17-alpine |
| 103 | + # container_name: libredb-postgres |
| 104 | + # restart: unless-stopped |
| 105 | + # environment: |
| 106 | + # POSTGRES_USER: postgres |
| 107 | + # POSTGRES_PASSWORD: postgres |
| 108 | + # POSTGRES_DB: libredb_storage |
| 109 | + # volumes: |
| 110 | + # - pgdata:/var/lib/postgresql/data |
| 111 | + # healthcheck: |
| 112 | + # test: ["CMD-SHELL", "pg_isready -U postgres"] |
| 113 | + # interval: 10s |
| 114 | + # timeout: 5s |
| 115 | + # retries: 5 |
| 116 | + |
| 117 | +# volumes: |
| 118 | +# libredb-data: # SQLite storage persistence |
| 119 | +# pgdata: # PostgreSQL storage persistence |
0 commit comments