sagar008 commited on
Commit
1182d91
·
verified ·
1 Parent(s): 5bf3c2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -1,19 +1,24 @@
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
-
5
- # Install system dependencies
 
 
 
6
  RUN apt-get update && apt-get install -y \
7
  git \
8
  && rm -rf /var/lib/apt/lists/*
9
-
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
 
 
 
13
  COPY . .
14
 
15
  ENV PYTHONUNBUFFERED=1
16
-
17
  EXPOSE 7860
18
 
19
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
5
+ ENV HF_HOME=/app/cache \
6
+ TRANSFORMERS_CACHE=/app/cache \
7
+ HF_DATASETS_CACHE=/app/cache \
8
+ XDG_CACHE_HOME=/app/cache
9
  RUN apt-get update && apt-get install -y \
10
  git \
11
  && rm -rf /var/lib/apt/lists/*
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ RUN python -c "\
16
+ from sentence_transformers import SentenceTransformer; \
17
+ SentenceTransformer('law-ai/InLegalBERT')"
18
+
19
  COPY . .
20
 
21
  ENV PYTHONUNBUFFERED=1
 
22
  EXPOSE 7860
23
 
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]