browser6 / Dockerfile
Alvin3y1's picture
Update Dockerfile
2622d8e verified
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
# 1. Install System Dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
curl \
wget \
gnupg \
xz-utils \
software-properties-common \
libgbm1 \
libnss3 \
libasound2 \
dbus-x11 \
matchbox-window-manager \
x11-xserver-utils \
x11-utils \
xauth \
x11-xkb-utils \
xkb-data \
libxfont2 \
libxrandr2 \
libxcursor1 \
libxi6 \
libxinerama1 \
libxkbfile1 \
libxtst6 \
ssl-cert \
libyaml-tiny-perl \
libhash-merge-simple-perl \
liblist-moreutils-perl \
libtry-tiny-perl \
libdatetime-timezone-perl
# 2. Fix 'libswitch-perl' Dependency (The Bulletproof Way)
# We add the focal repo temporarily to get the missing library
RUN echo "deb http://archive.ubuntu.com/ubuntu focal universe" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y libswitch-perl && \
sed -i '/focal/d' /etc/apt/sources.list && \
apt-get update
# 3. Install KasmVNC v1.3.1
RUN wget https://github.com/kasmtech/KasmVNC/releases/download/v1.3.1/kasmvncserver_jammy_1.3.1_amd64.deb && \
apt-get install -y ./kasmvncserver_*.deb && \
rm kasmvncserver_*.deb
# 4. 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
# 5. User Setup
RUN useradd -m -u 1000 user
USER user
WORKDIR $HOME
# 6. Configure KasmVNC (Custom Landing Page)
RUN mkdir -p $HOME/.vnc/www
RUN echo '<html><head><title>Status</title><meta http-equiv="refresh" content="2; url=vnc.html?autoconnect=true&reconnect=true&resize=scale"></head><body style="background:black;color:white;display:flex;justify-content:center;align-items:center;height:100vh;font-family:sans-serif;"><h1>Websocket started successfully</h1></body></html>' > $HOME/.vnc/www/index.html
# 7. Copy App Script (Explicitly copying to current WORKDIR)
COPY --chown=user app.py .
CMD ["python3", "app.py"]