File size: 607 Bytes
5bf3c2e
 
 
1182d91
 
 
 
 
5bf3c2e
 
 
 
 
 
1182d91
 
 
 
5bf3c2e
 
 
 
 
1182d91
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
FROM python:3.10-slim

WORKDIR /app
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
ENV HF_HOME=/app/cache \
    TRANSFORMERS_CACHE=/app/cache \
    HF_DATASETS_CACHE=/app/cache \
    XDG_CACHE_HOME=/app/cache
RUN apt-get update && apt-get install -y \
    git \
    && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

RUN python -c "\
from sentence_transformers import SentenceTransformer; \
SentenceTransformer('law-ai/InLegalBERT')"

COPY . .

ENV PYTHONUNBUFFERED=1
EXPOSE 7860

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]