mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 14:17:08 +00:00
feat: serve the UI from the backend image, one-port standalone stack
The backend image builds the web UI with scripts/build_frontend.sh and serves it through docsgpt/ui.py, so the standalone Compose file drops the frontend container. UI and API share port 7091, published on 127.0.0.1 unless DOCSGPT_BIND says otherwise. POSTGRES_PASSWORD is configurable, and an optional https profile puts Caddy in front of a public domain. docker-image-verify.yml starts the standalone stack on the image it built and checks the API, the UI, /config.js and a client-side route on one port.
This commit is contained in:
1 parent
0fcec68b67
commit
95fd4bdefe
9 files changed
+236
-51
No files matched your search
+16
-2
@@ -1,4 +1,4 @@
|
||||
# DocsGPT backend image.
|
||||
# DocsGPT image: the API, the web UI it serves, and the Celery worker.
|
||||
#
|
||||
# Build args:
|
||||
# EXTRAS comma-separated optional extras to bake in, matching the
|
||||
@@ -15,6 +15,19 @@
|
||||
# docling's layout/table/OCR models. `python -m docsgpt.scripts.verify_offline`
|
||||
# under `docker run --network none` proves it.
|
||||
|
||||
# The web UI, built by the same script the Python package build runs. The API
|
||||
# serves it from docsgpt/static (docsgpt/ui.py). The output is static files, so
|
||||
# this stage runs on the build machine's platform whatever the target is.
|
||||
FROM --platform=$BUILDPLATFORM node:22-bookworm-slim AS ui
|
||||
|
||||
WORKDIR /src
|
||||
COPY frontend/package.json frontend/package-lock.json frontend/
|
||||
RUN cd frontend && npm ci --include=dev --no-audit --no-fund
|
||||
COPY frontend/ frontend/
|
||||
COPY scripts/build_frontend.sh scripts/
|
||||
RUN mkdir docsgpt && bash scripts/build_frontend.sh
|
||||
|
||||
|
||||
FROM ubuntu:24.04 AS builder
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
@@ -87,7 +100,7 @@ RUN if [ "$INSTALL_TESSERACT" = "true" ]; then \
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/arc53/DocsGPT" \
|
||||
org.opencontainers.image.title="DocsGPT" \
|
||||
org.opencontainers.image.description="DocsGPT backend: API and Celery worker" \
|
||||
org.opencontainers.image.description="DocsGPT: API, web UI and Celery worker" \
|
||||
org.opencontainers.image.licenses="MIT"
|
||||
|
||||
WORKDIR /app
|
||||
@@ -136,6 +149,7 @@ RUN if python -c "import docling" 2>/dev/null; then \
|
||||
fi
|
||||
|
||||
COPY --chown=appuser:appuser docsgpt /app/docsgpt
|
||||
COPY --from=ui --chown=appuser:appuser /src/docsgpt/static /app/docsgpt/static
|
||||
# One-release alias so `-A application.app.celery` style entry points keep working.
|
||||
COPY --chown=appuser:appuser application/__init__.py /app/application/__init__.py
|
||||
|
||||
|
||||
Reference in new issue
Block a user