raw9 commited on
Commit
26527b7
·
verified ·
1 Parent(s): 1b3b125

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image hishebe Python 3.10 slim version bebohar kora hocche
2
+ FROM python:3.10-slim
3
+
4
+ # System update er shomoy jeno kono prompt na ashe
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # 1. Headless Chromium run korar jonno proyojoniyo shob Linux system dependencies install kora
8
+ RUN apt-get update && apt-get install -y \
9
+ wget \
10
+ curl \
11
+ gnupg \
12
+ libglib2.0-0 \
13
+ libnss3 \
14
+ libatk-bridge2.0-0 \
15
+ libcups2 \
16
+ libxcomposite1 \
17
+ libxdamage1 \
18
+ libxrandr2 \
19
+ libgbm1 \
20
+ libasound2 \
21
+ libpangocairo-1.0-0 \
22
+ libxss1 \
23
+ fonts-liberation \
24
+ libxcb-dri3-0 \
25
+ && rm -rf /var/lib/apt/lists/*
26
+
27
+ # 2. Working directory setup
28
+ WORKDIR /app
29
+
30
+ # 3. Prothome requirements.txt copy kore Python dependencies install kora
31
+ COPY requirements.txt .
32
+ RUN pip install --no-cache-dir -r requirements.txt
33
+
34
+ # 4. Playwright er maddhome nikhut vabe Chromium browser ebong tar baki dependencies install kora
35
+ RUN playwright install chromium
36
+ RUN playwright install-deps chromium
37
+
38
+ # 5. Apnar app er baki shob file copy kora (jemon main.py ba app.py)
39
+ COPY . .
40
+
41
+ # 6. Hugging Face er environment er jonno permission setup (Hugging Face non-root user e run hoy, tai eta oboshshok)
42
+ RUN chmod -R 777 /app
43
+
44
+ # 7. Hugging Face er default port expose kora
45
+ EXPOSE 7860
46
+
47
+ # 8. FastAPI server start korar final command
48
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]