Download Dockerfile from Jaosub/FengShui: direct link, hf CLI and curl.
- Browser
- Download file 824 Bytes
-
https://huggingface.co/spaces/Jaosub/FengShui/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Jaosub/FengShui/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Jaosub/FengShui/resolve/main/Dockerfile
824 Bytes
| # ---------------------------------------- | |
| # 1. Build Phase: Build Frontend React | |
| # ---------------------------------------- | |
| FROM node:20 AS frontend-builder | |
| WORKDIR /frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # ---------------------------------------- | |
| # 2. Run Phase: Run FastAPI Python Server | |
| # ---------------------------------------- | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install Python dependencies | |
| COPY backend/requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy Backend code | |
| COPY backend/ ./ | |
| # Copy built frontend assets to static folder in backend | |
| COPY --from=frontend-builder /frontend/dist ./static | |
| # Expose port for Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Run FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |