Consolidate stack into one docker-compose.yml + restore minio + publish port
- web_server: branded livtec/aido-web:local from ./web, pull_policy never - restore minio (S3 file store) the flattened compose dropped — api_server requires S3_ENDPOINT_URL=http://minio:9000 and won't start without it - nginx published on ${HOST_PORT:-3000} → out-of-the-box http://localhost:3000 - Makefile targets the single file (no override chain) - README: ./web layout, one-compose flow, USER_AUTH_SECRET + first-boot notes - gitignore runtime data dirs (db_volume, model caches) Verified: stack converges healthy on the single file; localhost:3000 + /api/health both 200.
This commit is contained in:
parent
63639567d0
commit
a7e31fcfbd
4 changed files with 65 additions and 27 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -9,6 +9,12 @@
|
||||||
.env
|
.env
|
||||||
.env.nginx
|
.env.nginx
|
||||||
|
|
||||||
|
# Runtime data created by the stack (bind mounts / model caches)
|
||||||
|
/db_volume/
|
||||||
|
/model_cache_huggingface/
|
||||||
|
/indexing_huggingface_model_cache/
|
||||||
|
/data/nginx/
|
||||||
|
|
||||||
# OS / editor noise
|
# OS / editor noise
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.log
|
*.log
|
||||||
|
|
|
||||||
11
Makefile
11
Makefile
|
|
@ -8,15 +8,12 @@
|
||||||
# make logs follow the web container logs
|
# make logs follow the web container logs
|
||||||
# make verify sanity-check that branding was applied (no stray "Onyx")
|
# make verify sanity-check that branding was applied (no stray "Onyx")
|
||||||
#
|
#
|
||||||
# The --project-directory . flag pins the Compose project dir to this repo root so
|
# Everything lives in a single self-contained docker-compose.yml: the branded
|
||||||
# the override's `./onyx/web` context and the root-level `.env` both resolve, while
|
# web image is built locally from ./web; every other service uses the official
|
||||||
# every other service is pulled unchanged from Onyx's official images.
|
# Onyx images unchanged. No override files to chain.
|
||||||
# ─────────────────────────────────────────────────────────────────────────────
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
# Use the no-letsencrypt prod compose by default (no TLS/domain needed). Override
|
COMPOSE = docker compose -f docker-compose.yml
|
||||||
# with `make COMPOSE_BASE=onyx/deployment/docker_compose/docker-compose.prod.yml`.
|
|
||||||
COMPOSE_BASE ?= ./docker-compose.yml
|
|
||||||
COMPOSE = docker compose --project-directory . -f $(COMPOSE_BASE) -f docker-compose.branding.yml
|
|
||||||
|
|
||||||
.PHONY: setup rebrand apply build up down restart logs verify config
|
.PHONY: setup rebrand apply build up down restart logs verify config
|
||||||
|
|
||||||
|
|
|
||||||
37
README.md
37
README.md
|
|
@ -23,7 +23,7 @@ therefore can't fully rebrand it. So we use a **thin-overlay** model:
|
||||||
│ branding/branding.config.json ← single source of truth (you edit) │
|
│ branding/branding.config.json ← single source of truth (you edit) │
|
||||||
│ │ │
|
│ │ │
|
||||||
│ ▼ node branding/apply-branding.mjs │
|
│ ▼ node branding/apply-branding.mjs │
|
||||||
│ onyx/web ← branding baked in (logo, favicon, name, links) │
|
│ ./web ← branding baked in (logo, favicon, name, links) │
|
||||||
│ │ │
|
│ │ │
|
||||||
│ ▼ docker compose build web_server │
|
│ ▼ docker compose build web_server │
|
||||||
│ livtec/aido-web:local ← the ONLY image we build │
|
│ livtec/aido-web:local ← the ONLY image we build │
|
||||||
|
|
@ -43,43 +43,50 @@ Onyx release is a re-checkout + re-run, not a fork to maintain (see
|
||||||
| Path | Purpose |
|
| Path | Purpose |
|
||||||
|------|---------|
|
|------|---------|
|
||||||
| `branding/branding.config.json` | **Single source of truth** — name, assets, links, emails, rename rules. |
|
| `branding/branding.config.json` | **Single source of truth** — name, assets, links, emails, rename rules. |
|
||||||
| `branding/apply-branding.mjs` | Applies the overlay into `onyx/web` (fetch assets, swap logos, repoint favicon, codemod strings). |
|
| `branding/apply-branding.mjs` | Applies the overlay into `./web` (fetch assets, swap logos, repoint favicon, codemod strings). |
|
||||||
| `branding/templates/` | Logo React components (filled from the config at apply time). |
|
| `branding/templates/` | Logo React components (filled from the config at apply time). |
|
||||||
| `branding/assets/` | Offline fallback copies of the fetched brand images. |
|
| `branding/assets/` | Offline fallback copies of the fetched brand images. |
|
||||||
| `docker-compose.branding.yml` | Thin override: build **only** `web_server` from `./onyx/web`, pull the rest. |
|
| `docker-compose.yml` | **One self-contained stack.** Branded web built from `./web`; everything else (incl. minio) uses official Onyx images. |
|
||||||
| `Makefile` | `make rebrand` / `apply` / `build` / `up` / `down` / `verify`. |
|
| `Makefile` | `make setup` / `rebrand` / `apply` / `build` / `up` / `down` / `verify`. |
|
||||||
| `.env.example`, `.env.nginx.example` | Deployment env templates (Onyx's standard vars — **not** branding). |
|
| `.env.example` | Deployment env template (Onyx's standard vars — **not** branding). |
|
||||||
| `onyx/` | Upstream Onyx checkout (pinned — see `branding.config.json → upstream`). |
|
| `web/`, `data/` | Upstream Onyx checkout (sparse: `web` + `deployment/data/nginx`), fetched by `make setup`. Git-ignored. |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 0a. one-time: fetch the upstream Onyx checkout at the pinned commit
|
# 0a. one-time: fetch the upstream Onyx sources (sparse checkout)
|
||||||
make setup
|
make setup
|
||||||
|
|
||||||
# 0b. one-time: copy the env templates and set real secrets
|
# 0b. one-time: copy the env template and set real secrets
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
cp .env.nginx.example .env.nginx
|
# In .env, set at minimum:
|
||||||
# edit .env → set MINIO_ROOT_PASSWORD / S3_AWS_SECRET_ACCESS_KEY, AUTH_TYPE, WEB_DOMAIN
|
# USER_AUTH_SECRET → REQUIRED, the API won't start blank: openssl rand -hex 32
|
||||||
# (for the no-letsencrypt profile, also place TLS certs — see .env.nginx.example)
|
# MINIO_ROOT_PASSWORD / S3_AWS_SECRET_ACCESS_KEY → strong values
|
||||||
|
# AUTH_TYPE → `disabled` for a quick local run, or oidc/basic for real auth
|
||||||
|
# HOST_PORT → optional, defaults to 3000
|
||||||
|
|
||||||
# 1. apply branding, build the branded web image, start the whole stack
|
# 1. apply branding, build the branded web image, start the whole stack
|
||||||
make rebrand
|
make rebrand
|
||||||
|
|
||||||
# …or step by step:
|
# …or step by step:
|
||||||
make apply # bake branding into ./onyx/web
|
make apply # bake branding into ./web
|
||||||
make build # build livtec/aido-web:local
|
make build # build livtec/aido-web:local
|
||||||
make up # start the stack (web branded, everything else official)
|
make up # start the full stack (one docker-compose.yml)
|
||||||
|
|
||||||
make logs # follow the web container
|
make logs # follow the web container
|
||||||
make verify # assert no stray "Onyx" remains in the shipping source
|
make verify # assert no stray "Onyx" remains in the shipping source
|
||||||
make down # stop
|
make down # stop
|
||||||
```
|
```
|
||||||
|
|
||||||
Requires Docker + Docker Compose v2 and Node ≥ 18 (for the apply script). The app is
|
Requires Docker + Docker Compose v2 and Node ≥ 18 (for the apply script). Once healthy,
|
||||||
served via nginx on ports 80/443.
|
open **http://localhost:3000** (set `HOST_PORT` to change the port; Traefik labels on
|
||||||
|
nginx still apply in production).
|
||||||
|
|
||||||
|
> **First boot** pulls the official images and the model server downloads embedding
|
||||||
|
> models (a few GB) — give it several minutes before nginx reports healthy. The api
|
||||||
|
> server waits on OpenSearch, minio and Postgres, so it's the last to go green.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,13 @@ services:
|
||||||
# - ${CA_CERT_PATH:-./custom-ca.crt}:/etc/ssl/certs/custom-ca.crt:ro
|
# - ${CA_CERT_PATH:-./custom-ca.crt}:/etc/ssl/certs/custom-ca.crt:ro
|
||||||
|
|
||||||
web_server:
|
web_server:
|
||||||
image: ${ONYX_WEB_SERVER_IMAGE:-onyxdotapp/onyx-web-server:${IMAGE_TAG:-latest}}
|
# Branded AIDO web image, built locally from ./web after `make apply`.
|
||||||
|
# This is the ONLY locally-built image; every other service below uses the
|
||||||
|
# official Onyx images unchanged. pull_policy: never => never overwrite it.
|
||||||
|
image: livtec/aido-web:local
|
||||||
|
pull_policy: never
|
||||||
build:
|
build:
|
||||||
context: ../../web
|
context: ./web
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
- NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-}
|
- NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-}
|
||||||
|
|
@ -218,6 +222,27 @@ services:
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
|
|
||||||
|
# Object (S3) file store. Official Onyx ships this; required by the backend
|
||||||
|
# (S3_ENDPOINT_URL=http://minio:9000). Without it api_server cannot start.
|
||||||
|
minio:
|
||||||
|
image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER:?set a strong value in .env}
|
||||||
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?set a strong value in .env}
|
||||||
|
MINIO_DEFAULT_BUCKETS: ${S3_FILE_STORE_BUCKET_NAME:-onyx-file-store-bucket}
|
||||||
|
command: server /data --console-address ":9001"
|
||||||
|
volumes:
|
||||||
|
- minio_data:/data
|
||||||
|
networks:
|
||||||
|
- onyx-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mc", "ready", "local"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 20s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
# Uncomment the block below to enable the MCP server for Onyx.
|
# Uncomment the block below to enable the MCP server for Onyx.
|
||||||
# mcp_server:
|
# mcp_server:
|
||||||
# image: ${ONYX_BACKEND_IMAGE:-onyxdotapp/onyx-backend:${IMAGE_TAG:-latest}}
|
# image: ${ONYX_BACKEND_IMAGE:-onyxdotapp/onyx-backend:${IMAGE_TAG:-latest}}
|
||||||
|
|
@ -461,9 +486,10 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- onyx-network
|
- onyx-network
|
||||||
- web
|
- web
|
||||||
#ports:
|
# Local access at http://localhost:3000 out of the box. The Traefik labels
|
||||||
# - "${HOST_PORT_80:-80}:80"
|
# above still apply in production; set HOST_PORT in .env to change the port.
|
||||||
# - "${HOST_PORT:-3000}:80" # allow for localhost:3000 usage, since that is the norm
|
ports:
|
||||||
|
- "${HOST_PORT:-3000}:80"
|
||||||
volumes:
|
volumes:
|
||||||
# Mount templates read-only; the startup command copies them into
|
# Mount templates read-only; the startup command copies them into
|
||||||
# the writable /etc/nginx/conf.d/ inside the container. This avoids
|
# the writable /etc/nginx/conf.d/ inside the container. This avoids
|
||||||
|
|
@ -554,6 +580,8 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
# Persistent data for OpenSearch.
|
# Persistent data for OpenSearch.
|
||||||
opensearch-data: null
|
opensearch-data: null
|
||||||
|
# Persistent data for the MinIO (S3) file store.
|
||||||
|
minio_data: null
|
||||||
networks:
|
networks:
|
||||||
onyx-network:
|
onyx-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue