The Dockerfile copied PRD.md, which is not in the repository, so a clean clone could not build at all. It also installed node and npm from Ubuntu 24 (node 18) to build a Vite 8 front end that needs node 20.19 or newer, and it built the interface into a directory nothing served. The build is now two stages: node:22 builds the interface, the CUDA runtime image installs the package and carries the built files. The API serves them when ELY_EYE_UI_DIR points at a directory that exists, and refuses to start when it is set but empty, naming the build command. The front end already calls /api/... on its own origin, so same-origin serving needs no client change.
35 lines
881 B
Docker
35 lines
881 B
Docker
FROM node:22-bookworm-slim AS ui
|
|
|
|
WORKDIR /ui
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci
|
|
COPY frontend ./
|
|
RUN npm run build
|
|
|
|
|
|
FROM nvidia/cuda:13.3.0-runtime-ubuntu24.04
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
ELY_EYE_HOME=/data/ely-eye \
|
|
ELY_EYE_RUNTIME_BACKEND=sglang \
|
|
ELY_EYE_SGLANG_BASE_URL=http://127.0.0.1:8000/v1 \
|
|
ELY_EYE_UI_DIR=/srv/ely-eye/ui
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends python3.12 python3.12-venv python3-pip ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY backend ./backend
|
|
COPY README.md ./
|
|
|
|
RUN python3.12 -m venv /opt/ely-eye \
|
|
&& /opt/ely-eye/bin/pip install --upgrade pip setuptools wheel \
|
|
&& /opt/ely-eye/bin/pip install ./backend
|
|
|
|
COPY --from=ui /ui/dist /srv/ely-eye/ui
|
|
|
|
EXPOSE 8765
|
|
CMD ["/opt/ely-eye/bin/ely-eye", "serve", "--host", "0.0.0.0", "--port", "8765"]
|