Spaces:
Sleeping
Sleeping
Download Dockerfile from Lijoice/StockScout: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/Lijoice/StockScout/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Lijoice/StockScout/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Lijoice/StockScout/resolve/main/Dockerfile
1.12 kB
| # --- Stage 1: Build the React Frontend --- | |
| FROM node:18-slim AS frontend-builder | |
| WORKDIR /build | |
| COPY stock-scout-dashboard/package*.json ./ | |
| RUN npm install | |
| COPY stock-scout-dashboard/ ./ | |
| RUN npm run build | |
| # --- Stage 2: Setup the Python Backend & Serve --- | |
| FROM python:3.11 | |
| WORKDIR /app | |
| # Install system dependencies for ML libraries and Postgres | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libpq-dev \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy backend requirements and install | |
| COPY backend/requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy backend code | |
| COPY backend/ ./backend/ | |
| # Copy built frontend from Stage 1 into the backend's static folder | |
| COPY --from=frontend-builder /build/dist ./backend/static/ | |
| # Environment variables for Hugging Face Spaces | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # Command to run the application | |
| # We use uvicorn to serve the FastAPI app on the port required by Hugging Face | |
| CMD ["python", "-m", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |