Download Dockerfile from MalikShehram/Neural-Link_Generative_Signal_Recovery: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/MalikShehram/Neural-Link_Generative_Signal_Recovery/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/MalikShehram/Neural-Link_Generative_Signal_Recovery/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/MalikShehram/Neural-Link_Generative_Signal_Recovery/resolve/main/Dockerfile
1.15 kB
| # ========================================== | |
| # Stage 1: Build the React + Vite 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: Setup the Python FastAPI Backend | |
| # ========================================== | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ========================================== | |
| # Stage 3: Hugging Face User Permissions & Final Assembly | |
| # ========================================== | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| # 1. Copy the backend and local project files into the user directory | |
| COPY --chown=user . $HOME/app | |
| # 2. Copy the compiled React frontend from Stage 1 into the EXACT folder FastAPI expects | |
| COPY --chown=user --from=frontend-builder /app/frontend/dist $HOME/app/frontend/dist | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] |