CadenShokat commited on
Commit
720052c
·
verified ·
1 Parent(s): d5f24a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -4
Dockerfile CHANGED
@@ -1,6 +1,17 @@
1
- FROM python:3.10
2
- WORKDIR /code
 
 
 
 
 
 
 
 
3
  COPY requirements.txt .
4
- RUN pip install -r requirements.txt
 
5
  COPY app.py .
6
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV HF_HOME=/data/hfcache \
4
+ TRANSFORMERS_CACHE=/data/hfcache \
5
+ PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1
7
+
8
+ RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
9
+
10
+ WORKDIR /app
11
  COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
  COPY app.py .
15
+
16
+ EXPOSE 7860
17
+ CMD bash -lc "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"