Spaces:
Sleeping
Sleeping
Download Dockerfile from Smart-Slate/Systematic-tool-review: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/Smart-Slate/Systematic-tool-review/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Smart-Slate/Systematic-tool-review/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Smart-Slate/Systematic-tool-review/resolve/main/Dockerfile
1.04 kB
| # Multi-stage build: compile the frontend, then serve it + the API from one | |
| # Python image. Hugging Face Docker Spaces require the app to listen on | |
| # port 7860 (see app_port in README.md's Space config below). | |
| # --- Stage 1: build the React frontend ------------------------------------- | |
| FROM node:20-slim AS frontend-build | |
| WORKDIR /app/frontend | |
| COPY frontend/package.json frontend/package-lock.json* ./ | |
| RUN npm install | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # --- Stage 2: Python backend, serving the built frontend as static files --- | |
| FROM python:3.11-slim | |
| WORKDIR /app/backend | |
| COPY backend/requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY backend/ ./ | |
| # main.py looks for ../../frontend/dist relative to app/main.py, i.e. | |
| # /app/frontend/dist from this WORKDIR � matches the path below. | |
| COPY --from=frontend-build /app/frontend/dist /app/frontend/dist | |
| # Hugging Face Docker Spaces expect port 7860. | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |