76 lines
1.8 KiB
Docker
76 lines
1.8 KiB
Docker
FROM python:3.11-slim as base
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
wget \
|
|
gnupg \
|
|
unzip \
|
|
curl \
|
|
ca-certificates \
|
|
fonts-liberation \
|
|
libasound2 \
|
|
libatk-bridge2.0-0 \
|
|
libatk1.0-0 \
|
|
libc6 \
|
|
libcairo2 \
|
|
libcups2 \
|
|
libdbus-1-3 \
|
|
libexpat1 \
|
|
libfontconfig1 \
|
|
libgbm1 \
|
|
libgcc1 \
|
|
libglib2.0-0 \
|
|
libgtk-3-0 \
|
|
libnspr4 \
|
|
libnss3 \
|
|
libpango-1.0-0 \
|
|
libpangocairo-1.0-0 \
|
|
libstdc++6 \
|
|
libx11-6 \
|
|
libx11-xcb1 \
|
|
libxcb1 \
|
|
libxcomposite1 \
|
|
libxcursor1 \
|
|
libxdamage1 \
|
|
libxext6 \
|
|
libxfixes3 \
|
|
libxi6 \
|
|
libxrandr2 \
|
|
libxrender1 \
|
|
libxss1 \
|
|
libxtst6 \
|
|
lsb-release \
|
|
xdg-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN wget -q -O /tmp/google-chrome.gpg https://dl-ssl.google.com/linux/linux_signing_key.pub \
|
|
&& gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg /tmp/google-chrome.gpg \
|
|
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
|
|
&& apt-get update \
|
|
&& apt-get install -y google-chrome-stable \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/google-chrome.gpg
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY src/ ./src/
|
|
|
|
RUN useradd -m -u 1000 proxyuser && \
|
|
chown -R proxyuser:proxyuser /app
|
|
|
|
USER proxyuser
|
|
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
|
|
CMD python -c "import sys; sys.path.insert(0, '/app/src'); from database import DatabaseManager; db = DatabaseManager(); db.get_stats(); db.close()" || exit 1
|
|
|
|
CMD ["python", "src/main.py"]
|