Download Dockerfile from Cardexa/app: direct link, hf CLI and curl.
- Browser
- Download file 897 Bytes
-
https://huggingface.co/spaces/Cardexa/app/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Cardexa/app/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Cardexa/app/resolve/main/Dockerfile
897 Bytes
| # Hugging Face Spaces - Docker (frontend + FastAPI backend) | |
| FROM node:20-bookworm-slim AS frontend-build | |
| WORKDIR /frontend | |
| COPY package.json package-lock.json ./ | |
| RUN npm ci | |
| COPY . . | |
| RUN npm run build | |
| FROM python:3.11-slim AS runtime | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # System deps for opencv | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 libglib2.0-0 ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Copy backend + built static frontend | |
| COPY backend /app/backend | |
| COPY --from=frontend-build /frontend/dist /app/static | |
| # Copy scaler + model into image | |
| COPY scaler.save /app/scaler.save | |
| COPY model.keras /app/model.keras | |
| ENV STATIC_DIR=/app/static | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |