File size: 809 Bytes
6f7f8d3 1039bcd 6f7f8d3 1039bcd 6f7f8d3 1039bcd 6f7f8d3 1039bcd 6f7f8d3 1039bcd 6f7f8d3 d1a8e48 6f7f8d3 d1a8e48 | 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 | FROM python:3.9-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
wget unzip gnupg2 curl \
libglib2.0-0 libnss3 libgconf-2-4 libxi6 libxcursor1 \
libxcomposite1 libasound2 libxtst6 libxrandr2 xdg-utils \
fonts-liberation libu2f-udev libvulkan1 libxss1 \
chromium chromium-driver \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create and use unprivileged user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install Python packages
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the app
COPY --chown=user . /app
# Expose port for Flask app
EXPOSE 7860
# Run Flask application
CMD ["python3", "app.py"] |