Reflectus commited on
Commit
26be6ce
·
verified ·
1 Parent(s): 2334910

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +83 -0
Dockerfile ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Установка системных зависимостей для Chrome
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ unzip \
8
+ libnss3 \
9
+ libxcb1 \
10
+ libxcomposite1 \
11
+ libxcursor1 \
12
+ libxdamage1 \
13
+ libxext6 \
14
+ libxfixes3 \
15
+ libxi6 \
16
+ libxrandr2 \
17
+ libxrender1 \
18
+ libxss1 \
19
+ libxtst6 \
20
+ fonts-liberation \
21
+ libappindicator3-1 \
22
+ libasound2 \
23
+ libatk-bridge2.0-0 \
24
+ libatk1.0-0 \
25
+ libc6 \
26
+ libcairo2 \
27
+ libcups2 \
28
+ libdbus-1-3 \
29
+ libexpat1 \
30
+ libfontconfig1 \
31
+ libgbm1 \
32
+ libgcc1 \
33
+ libgconf-2-4 \
34
+ libgdk-pixbuf2.0-0 \
35
+ libglib2.0-0 \
36
+ libgtk-3-0 \
37
+ libnspr4 \
38
+ libpango-1.0-0 \
39
+ libpangocairo-1.0-0 \
40
+ libstdc++6 \
41
+ libx11-6 \
42
+ libx11-xcb1 \
43
+ libxcb1 \
44
+ libxcomposite1 \
45
+ libxcursor1 \
46
+ libxdamage1 \
47
+ libxext6 \
48
+ libxfixes3 \
49
+ libxi6 \
50
+ libxrandr2 \
51
+ libxrender1 \
52
+ libxss1 \
53
+ libxtst6 \
54
+ lsb-release \
55
+ xdg-utils \
56
+ && rm -rf /var/lib/apt/lists/*
57
+
58
+ # Установка Google Chrome
59
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
60
+ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
61
+ && apt-get update \
62
+ && apt-get install -y google-chrome-stable \
63
+ && rm -rf /var/lib/apt/lists/*
64
+
65
+ WORKDIR /app
66
+
67
+ COPY requirements.txt .
68
+ RUN pip install --no-cache-dir -r requirements.txt
69
+
70
+ # Предустановка драйверов Botasaurus
71
+ RUN python -c "from botasaurus.browser import driver; driver.install()"
72
+
73
+ COPY . .
74
+
75
+ # Настройка пользователя для Hugging Face
76
+ RUN useradd -m -u 1000 user
77
+ USER user
78
+ ENV HOME=/home/user \
79
+ PATH=/home/user/.local/bin:$PATH
80
+
81
+ EXPOSE 7860
82
+
83
+ CMD ["python", "app.py"]