File size: 990 Bytes
0d93196
ef2a489
61a8797
0d93196
 
 
 
 
61a8797
 
0d93196
 
 
 
 
61a8797
 
0d93196
 
ef2a489
61a8797
0d93196
ef2a489
61a8797
0d93196
 
5223ad5
0d93196
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Dockerfile — last updated: Dec 2025
FROM python:3.11-slim

# Install system deps required by Playwright/Chromium
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates fonts-liberation libnss3 libatk1.0-0 libatk-bridge2.0-0 \
    libcups2 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2 \
    libpangocairo-1.0-0 libxss1 wget gnupg dirmngr \
    && rm -rf /var/lib/apt/lists/*

# ensure pip is latest and install packages to user site
RUN python -m pip install --upgrade pip
RUN useradd -m -u 1000 appuser
USER appuser
ENV PATH="/home/appuser/.local/bin:$PATH"
WORKDIR /app

# copy requirements and install (user site)
COPY --chown=appuser:appuser requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Install Playwright browsers (with deps)
RUN python -m playwright install chromium

# Copy app source
COPY --chown=appuser:appuser . .

# Expose port used by Gradio
ENV GRADIO_SERVER_PORT=7860
CMD ["python", "app.py"]