File size: 1,253 Bytes
8664eb7 | 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | FROM python:3.9-slim-bullseye
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
curl \
gnupg \
xvfb \
x11vnc \
fluxbox \
novnc \
net-tools \
&& rm -rf /var/lib/apt/lists/*
# Install Brave Browser
RUN curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list && \
apt-get update && apt-get install -y brave-browser
# Install websockify (Python bridge for noVNC)
RUN pip install websockify
# Set up a non-root user (Brave/Chrome requires this or --no-sandbox)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set working directory
WORKDIR $HOME/app
# Copy application files
COPY --chown=user:user app.py .
# Environment variables
ENV DISPLAY=:0 \
RESOLUTION=1280x720
# Expose the port
EXPOSE 7860
# Start the application
CMD ["python", "app.py"] |