itemaz commited on
Commit
53ce6e5
·
verified ·
1 Parent(s): 9095d2c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -28
Dockerfile CHANGED
@@ -1,45 +1,29 @@
1
  FROM python:3.11-slim
2
 
3
- # 1. System dependencies
4
  RUN apt-get update && apt-get install -y \
5
- default-jre \
6
- libgl1 \
7
- libglx-mesa0 \
8
- libglib2.0-0 \
9
- gcc \
10
- g++ \
11
- libgomp1 \
12
- && rm -rf /var/lib/apt/lists/*
13
 
14
  WORKDIR /app
15
 
16
- # 2. Paths
17
- ENV HOME=/tmp
18
- ENV PADDLE_HOME=/tmp/.paddle
19
  ENV HF_HOME=/tmp/.cache
20
- # Disable the slow connectivity check mentioned in your logs
21
- ENV PADDLE_PDX_DISABLE_MODEL_SOURCE_CHECK=True
22
 
23
- # 3. Pip and Requirements
24
- COPY requirements.txt .
25
- RUN pip install --no-cache-dir --upgrade pip && \
26
- pip install --no-cache-dir -r requirements.txt
27
 
28
- # 4. Install Paddle (Standard version for Python 3.11)
29
- RUN pip install --no-cache-dir paddlepaddle paddleocr gunicorn whitenoise
 
30
 
31
- # 5. PRE-DOWNLOAD PADDLE MODELS (Updated for newest API)
32
- # We removed use_gpu and updated use_angle_cls to use_textline_orientation
33
- RUN python3 -c "from paddleocr import PaddleOCR; PaddleOCR(lang='ru', use_textline_orientation=True)"
34
 
35
- # 6. Project files
36
  COPY . .
37
-
38
- # 7. Django static
39
  RUN python manage.py collectstatic --noinput
40
 
41
- # 8. Run
42
  ENV PORT=7860
43
  EXPOSE 7860
44
 
45
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "--workers", "1", "litrix.wsgi:application"]
 
 
1
  FROM python:3.11-slim
2
 
3
+
4
  RUN apt-get update && apt-get install -y \
5
+ default-jre libgl1 libglx-mesa0 libglib2.0-0 gcc g++ \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
 
 
 
 
 
8
 
9
  WORKDIR /app
10
 
11
+
12
+ # Важно: используем /data, если он есть, или /tmp
 
13
  ENV HF_HOME=/tmp/.cache
 
 
14
 
 
 
 
 
15
 
16
+ COPY requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+ RUN pip install gunicorn whitenoise
19
 
 
 
 
20
 
 
21
  COPY . .
 
 
22
  RUN python manage.py collectstatic --noinput
23
 
24
+
25
  ENV PORT=7860
26
  EXPOSE 7860
27
 
28
+
29
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "--workers", "1", "litrix.wsgi:application"]