Yermek68 commited on
Commit
9459ab7
·
verified ·
1 Parent(s): 6bd8ccf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -11
Dockerfile CHANGED
@@ -1,18 +1,30 @@
1
- # ================================
2
- # Custom lightweight container for Eroha AgentAPI
3
- # ================================
4
-
5
  FROM python:3.10-slim
6
 
7
- # Обновляем пакеты и ставим нужные зависимости
8
- RUN apt-get update && apt-get install -y git ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
9
 
10
- # Копируем файлы проекта
11
  WORKDIR /app
12
  COPY . /app
13
 
14
- # Устанавливаем только то, что нужно
15
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
- # Запускаем FastAPI
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # =============== BASE IMAGE ======================
 
 
 
2
  FROM python:3.10-slim
3
 
4
+ # =============== SYSTEM DEPENDENCIES ======================
5
+ RUN apt-get update && apt-get install -y \
6
+ git \
7
+ ffmpeg \
8
+ libsm6 \
9
+ libxext6 \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # =============== COPY FILES ======================
13
  WORKDIR /app
14
  COPY . /app
15
 
16
+ # =============== INSTALL DEPENDENCIES ======================
17
+ RUN pip install --no-cache-dir --upgrade pip \
18
+ && pip install --no-cache-dir -r requirements.txt \
19
+ && pip install --no-cache-dir "huggingface-hub==0.23.4" \
20
+ && pip uninstall -y gradio gradio-client spaces || true
21
+
22
+ # =============== SET ENVIRONMENT ======================
23
+ ENV HF_HOME=/tmp/huggingface
24
+ ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
25
+ ENV PYTHONUNBUFFERED=1
26
+
27
+ # =============== EXPOSE & RUN ======================
28
+ EXPOSE 7860
29
+ CMD ["python", "app.py"]
30