Files
nas-tools/dashboard/Dockerfile
T
Gan, Jimmy ee72a891d5
Deploy Dashboard (Dev) / deploy-dev (push) Has started running
Run Tests / Backend Tests (push) Has been cancelled
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Test Summary (push) Has been cancelled
perf: optimize build speed with pip mirror and BuildKit
2026-04-04 00:19:43 +08:00

21 lines
773 B
Docker

# Stage 1: Build frontend
FROM node:20-alpine AS frontend
WORKDIR /build
COPY frontend/package.json frontend/package-lock.json* ./
COPY frontend/ ./
RUN npm install --registry=https://registry.npmmirror.com && npm run build
# Stage 2: Python runtime
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends openssh-client && rm -rf /var/lib/apt/lists/*
RUN adduser --disabled-password --no-create-home --gecos "" app
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir --index-url https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY backend/ ./
COPY --from=frontend /build/dist /app/static
RUN chown -R app:app /app
USER app
EXPOSE 4000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "4000"]