Spaces:
Sleeping
Sleeping
Download Dockerfile from tokakhaled24/LexAI: direct link, hf CLI and curl.
- Browser
- Download file 2.5 kB
-
https://huggingface.co/spaces/tokakhaled24/LexAI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/tokakhaled24/LexAI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tokakhaled24/LexAI/resolve/main/Dockerfile
2.5 kB
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # LexAI β Dockerfile for Hugging Face Spaces | |
| # Only difference from local: port 7860 (required by HF Spaces) | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # ββ System libraries ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ββ Working directory βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| WORKDIR /app | |
| # ββ Install Python dependencies βββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY requirements.txt . | |
| RUN sed 's/#.*//' requirements.txt > requirements_clean.txt \ | |
| && pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements_clean.txt | |
| # ββ Pre-download ML models at build time βββββββββββββββββββββββββββββββββββββ | |
| RUN python - <<'EOF' | |
| from sentence_transformers import SentenceTransformer, CrossEncoder | |
| SentenceTransformer("paraphrase-multilingual-MiniLM-L12-v2") | |
| CrossEncoder("cross-encoder/mmarco-mMiniLMv2-L12-H384-v1") | |
| print("Models downloaded successfully.") | |
| EOF | |
| # ββ Copy application code βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY main.py . | |
| COPY app/ ./app/ | |
| COPY static/ ./static/ | |
| COPY extracted_text_en.txt . | |
| # ββ HF Spaces requires port 7860 βββββββββββββββββββββββββββββββββββββββββββββ | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |