Spaces:
Sleeping
Sleeping
Download Dockerfile from orakzai-io/Async_Web_scraper: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/orakzai-io/Async_Web_scraper/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/orakzai-io/Async_Web_scraper/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/orakzai-io/Async_Web_scraper/resolve/main/Dockerfile
1.08 kB
| # --- Stage 1: Build the Frontend --- | |
| FROM node:20-alpine AS frontend-builder | |
| WORKDIR /app/Frontend | |
| COPY Frontend/package*.json ./ | |
| RUN npm install | |
| COPY Frontend/ ./ | |
| RUN npm run build | |
| # --- Stage 2: Final Backend Image --- | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies (needed for certain python packages) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libpq-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Backend dependencies | |
| COPY Backend/requirements.txt ./Backend/ | |
| RUN pip install --no-cache-dir -r Backend/requirements.txt | |
| # Copy Backend source code | |
| COPY Backend/ ./Backend/ | |
| # Copy the built Frontend files to the Backend's dist directory | |
| # (FastAPI in Backend/main.py is configured to serve this) | |
| COPY --from=frontend-builder /app/Frontend/dist ./Backend/dist | |
| # Expose the API port (Hugging Face Spaces defaults to 8000/7860) | |
| EXPOSE 7860 | |
| # Set the working directory to Backend for file imports to work | |
| WORKDIR /app/Backend | |
| # Command to run the application | |
| CMD ["python", "main.py"] | |