Yermek68 commited on
Commit
3e8f6fd
·
verified ·
1 Parent(s): a8162e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -23
Dockerfile CHANGED
@@ -1,37 +1,20 @@
1
- # ======================================
2
- # Eroha AgentAPI v5.9 — Enterprise Edition
3
- # Stable Docker Build (Self-Healing + Cache)
4
- # ======================================
5
-
6
  FROM python:3.10-slim
7
 
8
- # ————— Базовые оптимизации
9
- ENV PYTHONUNBUFFERED=1 \
10
- HF_HUB_DISABLE_SYMLINKS_WARNING=1 \
11
- TRANSFORMERS_CACHE=/root/.cache/huggingface/transformers \
12
- HF_HOME=/root/.cache/huggingface \
13
- APP_HOME=/app
14
-
15
- WORKDIR ${APP_HOME}
16
 
17
- # ————— Установка системных зависимостей
18
- RUN apt-get update && apt-get install -y \
19
- git wget curl libsndfile1 ffmpeg \
20
- && rm -rf /var/lib/apt/lists/*
21
 
22
- # ————— Установка зависимостей Python
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
- # ————— Копирование приложения
27
  COPY app.py .
28
 
29
- # ————— Кэширование модели fallback (для офлайн-режима)
30
  RUN python -c "from transformers import pipeline; pipeline('text-generation', model='sshleifer/tiny-gpt2')"
31
 
32
- # ————— Среда
33
  EXPOSE 7860
34
- ENV PORT=7860
35
 
36
- # ————— Запуск с watchdog для авто-восстановления
37
  CMD ["python", "app.py"]
 
1
+ # ---- Base Image ----
 
 
 
 
2
  FROM python:3.10-slim
3
 
4
+ WORKDIR /app
 
 
 
 
 
 
 
5
 
6
+ # ---- System deps ----
7
+ RUN apt-get update && apt-get install -y git wget curl && rm -rf /var/lib/apt/lists/*
 
 
8
 
9
+ # ---- Copy project ----
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
13
  COPY app.py .
14
 
15
+ # ---- Preload fallback model ----
16
  RUN python -c "from transformers import pipeline; pipeline('text-generation', model='sshleifer/tiny-gpt2')"
17
 
 
18
  EXPOSE 7860
 
19
 
 
20
  CMD ["python", "app.py"]