compose: add admin-ui service on port 3040 (Next standalone)
Expose Velzon admin dashboard in docker-compose with ERROR_REPORTING_UI_DEMO=1 by default until admin API serves /v1/incidents. Document env vars in .env.example. Co-Authored-By: Paperclip <[email protected]>
This commit is contained in:
1 parent
a9d85a2fec
commit
563f644861
5 files changed
+68
-1
No files matched your search
@@ -9,6 +9,13 @@ ER_MYSQL_DATABASE=error_reporting
|
||||
# Host port mapped to MariaDB (container listens on 3306)
|
||||
ER_PUBLISH_MYSQL_PORT=3306
|
||||
|
||||
# --- Admin UI (Next.js, service: admin-ui) ---
|
||||
ER_PUBLISH_ADMIN_PORT=3040
|
||||
# 1 = Velzon layout with demo data (no admin API required). 0 = require ERROR_REPORTING_ADMIN_API_BASE.
|
||||
ERROR_REPORTING_UI_DEMO=1
|
||||
# When admin Fastify API serves /v1/incidents (service `api`, not ingest-api), e.g.:
|
||||
# ERROR_REPORTING_ADMIN_API_BASE=http://api:3050
|
||||
|
||||
# --- Ingest API (service: ingest-api) ---
|
||||
ER_PUBLISH_INGEST_PORT=3041
|
||||
# Optional rate limiting (defaults match ingest-api/src/config/env.ts)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
@@ -0,0 +1,26 @@
|
||||
# Next.js 15 admin UI (Velzon-style) — production image for docker-compose.
|
||||
FROM node:20-bookworm-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:20-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-bookworm-slim AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3040
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
RUN addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 nextjs
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
USER nextjs
|
||||
EXPOSE 3040
|
||||
CMD ["node", "server.js"]
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
reactStrictMode: true,
|
||||
};
|
||||
|
||||
|
||||
+28
-1
@@ -5,7 +5,9 @@
|
||||
# cp .env.example .env
|
||||
# docker compose up --build
|
||||
#
|
||||
# Verify: curl -sf http://127.0.0.1:${ER_PUBLISH_INGEST_PORT:-3041}/health
|
||||
# Verify:
|
||||
# curl -sf http://127.0.0.1:${ER_PUBLISH_INGEST_PORT:-3041}/health
|
||||
# curl -sfI http://127.0.0.1:${ER_PUBLISH_ADMIN_PORT:-3040}/
|
||||
#
|
||||
# Docs: docs/deployment/bitreport-error-reporting-compose-proxmox.md
|
||||
|
||||
@@ -102,3 +104,28 @@ services:
|
||||
ER_COLLECTOR_PROJECT_ALPHA_TOKEN: ${ER_COLLECTOR_PROJECT_ALPHA_TOKEN:-er_tst_a_secret_one}
|
||||
COLLECTOR_DEFAULT_INGEST_TOKEN: ${COLLECTOR_DEFAULT_INGEST_TOKEN:-}
|
||||
restart: unless-stopped
|
||||
|
||||
admin-ui:
|
||||
build:
|
||||
context: ./admin-ui
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
ingest-api:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
# Default demo KPIs/layout until admin API exposes /v1/incidents (set to 0 and set ERROR_REPORTING_ADMIN_API_BASE).
|
||||
ERROR_REPORTING_UI_DEMO: ${ERROR_REPORTING_UI_DEMO:-1}
|
||||
ERROR_REPORTING_ADMIN_API_BASE: ${ERROR_REPORTING_ADMIN_API_BASE:-}
|
||||
ports:
|
||||
- "${ER_PUBLISH_ADMIN_PORT:-3040}:3040"
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"node -e \"fetch('http://127.0.0.1:3040/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
start_period: 45s
|
||||
Reference in new issue
Block a user