Spaces:
Running
Running
Download Dockerfile from iThors/PDF_Tokenizer: direct link, hf CLI and curl.
- Browser
- Download file 840 Bytes
-
https://huggingface.co/spaces/iThors/PDF_Tokenizer/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/iThors/PDF_Tokenizer/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/iThors/PDF_Tokenizer/resolve/main/Dockerfile
840 Bytes
| # ---------- Frontend build ---------- | |
| FROM node:18-alpine AS frontend | |
| WORKDIR /app | |
| COPY frontend/package.json frontend/package-lock.json ./ | |
| RUN npm ci | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # ---------- Backend runtime ---------- | |
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential libffi-dev libgl1 libxrender1 libxext6 libfontconfig1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| ENV DB_PATH=/tmp/usage.db | |
| # Install backend deps | |
| COPY backend/requirements.txt . | |
| RUN pip install -r requirements.txt | |
| # Copy backend code | |
| COPY backend/ ./ | |
| # Bring in built frontend as static assets | |
| COPY --from=frontend /app/dist ./static | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |