2026-06-05 22:40:04 +08:00
|
|
|
# Nexus 6.0 — production image (frontend build + API)
|
|
|
|
|
# Build: docker compose -f docker/docker-compose.prod.yml build
|
|
|
|
|
# See: docs/design/plans/2026-06-04-1panel-docker-production.md
|
|
|
|
|
|
|
|
|
|
# ── Stage 1: Vue/Vite SPA ──
|
|
|
|
|
FROM node:20-bookworm-slim AS frontend
|
|
|
|
|
WORKDIR /build/frontend
|
|
|
|
|
|
|
|
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
|
|
|
RUN npm ci --ignore-scripts
|
|
|
|
|
|
|
|
|
|
COPY frontend/ ./
|
|
|
|
|
RUN npx vite build
|
|
|
|
|
|
|
|
|
|
# ── Stage 2: Python API + built static assets ──
|
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
|
|
|
|
|
|
RUN apt-get update \
|
2026-06-08 02:10:06 +08:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
|
curl \
|
|
|
|
|
openssh-client \
|
|
|
|
|
rsync \
|
|
|
|
|
sshpass \
|
2026-06-05 22:40:04 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
COPY server/ ./server/
|
|
|
|
|
COPY web/agent/ ./web/agent/
|
|
|
|
|
COPY --from=frontend /build/web/app ./web/app/
|
2026-06-08 11:17:21 +08:00
|
|
|
# Login wallpaper cache (Vite does not emit this dir; sync also writes here at runtime)
|
|
|
|
|
COPY web/app/wallpapers/ ./web/app/wallpapers/
|
2026-06-08 03:15:40 +08:00
|
|
|
# Install wizard + static SPA assets not emitted by Vite
|
2026-06-06 00:36:03 +08:00
|
|
|
COPY web/app/install.html ./web/app/install.html
|
2026-06-08 03:15:40 +08:00
|
|
|
COPY web/app/servers_import_template.csv ./web/app/servers_import_template.csv
|
2026-06-06 01:14:59 +08:00
|
|
|
RUN mkdir -p ./web/app/vendor
|
2026-06-06 00:36:03 +08:00
|
|
|
COPY web/app/vendor/tailwindcss-browser.js \
|
|
|
|
|
web/app/vendor/theme-init.js \
|
|
|
|
|
web/app/vendor/theme.css \
|
|
|
|
|
web/app/vendor/alpinejs.min.js \
|
|
|
|
|
./web/app/vendor/
|
2026-06-05 22:40:04 +08:00
|
|
|
COPY docker/entrypoint.sh ./docker/entrypoint.sh
|
2026-06-06 01:14:59 +08:00
|
|
|
RUN chmod +x ./docker/entrypoint.sh \
|
|
|
|
|
&& test -f /app/web/app/install.html \
|
|
|
|
|
&& test -f /app/web/app/vendor/alpinejs.min.js \
|
|
|
|
|
&& test -f /app/web/app/vendor/tailwindcss-browser.js \
|
|
|
|
|
&& test -f /app/web/app/vendor/theme.css \
|
|
|
|
|
&& test -f /app/web/app/vendor/theme-init.js
|
2026-06-05 22:40:04 +08:00
|
|
|
|
|
|
|
|
ENV PYTHONPATH=/app \
|
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
|
NEXUS_HOST=0.0.0.0 \
|
|
|
|
|
NEXUS_PORT=8600
|
|
|
|
|
|
|
|
|
|
EXPOSE 8600
|
|
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=90s --retries=3 \
|
|
|
|
|
CMD curl -sf http://127.0.0.1:8600/health | grep -q '^ok' || exit 1
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/app/docker/entrypoint.sh"]
|
|
|
|
|
CMD ["uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "8600"]
|