felixbet commited on
Commit
b91b75c
·
verified ·
1 Parent(s): 5e47fb3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,17 +1,18 @@
1
  FROM python:3.10-slim
2
- WORKDIR /app
3
 
4
- RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
5
- && rm -rf /var/lib/apt/lists/*
 
 
6
 
7
- COPY requirements.txt .
8
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
9
 
10
- COPY app.py start.sh ./
11
- RUN chmod +x /app/start.sh
12
 
13
- ENV PORT=7860
14
  EXPOSE 7860
15
-
16
- # ✅ This guarantees we download & extract before importing app.py
17
- CMD ["bash", "/app/start.sh"]
 
1
  FROM python:3.10-slim
 
2
 
3
+ ENV PIP_NO_CACHE_DIR=1 \
4
+ HF_HOME=/root/.cache/huggingface \
5
+ HF_MODEL_ID=monologg/biobert_v1.1_pubmed \
6
+ TORCH_THREADS=1
7
 
8
+ RUN pip install --upgrade pip && \
9
+ pip install "fastapi==0.115.0" "uvicorn[standard]==0.30.6" \
10
+ "transformers==4.43.4" "tokenizers>=0.15" \
11
+ --index-url https://download.pytorch.org/whl/cpu \
12
+ "torch==2.3.1+cpu"
13
 
14
+ WORKDIR /app
15
+ COPY app.py /app/app.py
16
 
 
17
  EXPOSE 7860
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]