FROM node:20-alpine AS frontend-build WORKDIR /app/webapp/frontend COPY webapp/frontend/package.json webapp/frontend/package-lock.json ./ # Ensure devDependencies (like Vite) are installed so the build command works RUN npm ci --include=dev COPY webapp/frontend/ ./ RUN npm run build FROM python:3.13-slim AS runtime ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ APP_HOST=0.0.0.0 \ APP_PORT=8080 \ LOG_LEVEL=info WORKDIR /app # Use HTTPS mirrors so apt works even if HTTP (port 80) is blocked in the network. RUN sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list \ && sed -i 's|http://security.debian.org|https://security.debian.org|g' /etc/apt/sources.list \ && apt-get update \ && apt-get install -y --no-install-recommends libgomp1 \ && rm -rf /var/lib/apt/lists/* COPY pyproject.toml setup.py README.md ./ COPY src ./src COPY webapp/backend ./webapp/backend COPY data ./data RUN pip install --no-cache-dir --upgrade pip \ && pip install --no-cache-dir ".[web]" COPY --from=frontend-build /app/webapp/frontend/dist ./webapp/frontend/dist RUN mkdir -p /app/var/jobs VOLUME ["/app/var"] EXPOSE 8080 CMD ["sh", "-c", "uvicorn webapp.backend.main:app --host ${APP_HOST} --port ${APP_PORT} --log-level ${LOG_LEVEL}"]