misukisu commited on
Commit
d8e54f6
·
verified ·
1 Parent(s): 4f1b132

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ PYTHONUNBUFFERED=1 \
5
+ PORT=7860 \
6
+ HOME=/home/user
7
+
8
+ # Install OS libraries required by Chromium & headless automation
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ wget curl gnupg ca-certificates libglib2.0-0 libnss3 libnspr4 \
11
+ libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libdbus-1-3 libxcb1 \
12
+ libxkbcommon0 libx11-6 libxcomposite1 libxdamage1 libxext6 libxfixes3 \
13
+ libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 \
14
+ fonts-liberation fonts-noto-color-emoji \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Hugging Face standard non-root user (UID 1000)
18
+ RUN useradd -m -u 1000 user
19
+ WORKDIR /home/user/app
20
+
21
+ COPY --chown=user:user requirements.txt .
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Download Patchright's stealth Chromium build
25
+ RUN patchright install chromium --with-deps
26
+
27
+ COPY --chown=user:user . .
28
+
29
+ USER user
30
+ EXPOSE 7860
31
+
32
+ CMD ["python", "app.py"]