Download Dockerfile from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/Dockerfile
1.14 kB
| # Build Stage: Frontend | |
| FROM node:20-slim AS frontend-builder | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install | |
| COPY frontend/ . | |
| RUN npm run build | |
| # Final Stage: Backend + Static Frontend | |
| FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim | |
| # Create a non-root user (HF Spaces requirement for some features/security) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Install system dependencies (requires root) | |
| USER root | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| USER user | |
| # Copy backend dependency files | |
| COPY --chown=user pyproject.toml uv.lock ./ | |
| # Install dependencies | |
| RUN uv sync --frozen | |
| # Copy the rest of the backend code | |
| COPY --chown=user . . | |
| # Copy built frontend from the builder stage | |
| COPY --from=frontend-builder --chown=user /app/frontend/dist ./frontend/dist | |
| # Expose the default HF Spaces port | |
| EXPOSE 7860 | |
| # Set environment variables for HF | |
| ENV HOST=0.0.0.0 | |
| ENV PORT=7860 | |
| # Run the application | |
| CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |