File size: 1,067 Bytes
fc7db98
 
5353eed
 
 
fc7db98
5353eed
 
 
 
fc7db98
5353eed
fc7db98
 
5353eed
 
fc7db98
 
9ea8d9d
 
 
5353eed
9ea8d9d
5353eed
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Hugging Face Space — all code copied into Space repo (no GitHub clone needed).
# Run sync_to_space.ps1 from project root, then git push the Space repo.
FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user

WORKDIR /app/repo

COPY src/deploy/backend/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt huggingface_hub \
    && python -m spacy download en_core_web_sm

COPY --chown=user:user src/ /app/repo/

RUN chmod +x /app/repo/deploy/huggingface/entrypoint.sh \
    && mkdir -p /home/user/model /home/user/.cache/huggingface \
    && chown -R user:user /home/user

ENV MODEL_PATH=/home/user/model
ENV HF_MODEL_REPO=uzzam24/deberta-complexity-lcp
ENV APP_ROOT=/app/repo
ENV PYTHONPATH=/app/repo:/app/repo/deploy/backend
ENV PORT=7860
ENV CORS_ALLOW_ALL=1
ENV EAGER_LOAD_MODEL=1
ENV HF_HOME=/home/user/.cache/huggingface

USER user
EXPOSE 7860

CMD ["/app/repo/deploy/huggingface/entrypoint.sh"]