aliMohammad16 commited on
Commit
bbde13c
·
verified ·
1 Parent(s): e167b93

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,18 +1,21 @@
1
- FROM nvidia/cuda:11.8.0-base-ubuntu22.04
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y python3 python3-pip git curl && rm -rf /var/lib/apt/lists/*
 
 
 
6
 
7
- RUN pip3 install --no-cache-dir \
8
- torch torchvision torchaudio \
9
- transformers fastapi uvicorn accelerate bitsandbytes
10
 
11
- COPY app.py /app/app.py
12
- COPY requirements.txt /app/requirements.txt
13
 
14
- ENV CUDA_VISIBLE_DEVICES=0
 
15
 
16
- EXPOSE 8000
 
17
 
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ build-essential \
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 app.py .
 
14
 
15
+ RUN mkdir -p /tmp/transformers_cache && \
16
+ chmod 777 /tmp/transformers_cache
17
 
18
+ RUN useradd -m appuser
19
+ USER appuser
20
 
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]