Use noVNC static bundle with websockify and trim apt packages to reduce image size while keeping emoji support and VNC tools.
98 lines
2.7 KiB
Docker
98 lines
2.7 KiB
Docker
FROM debian:bookworm-slim
|
|
|
|
# Metadata
|
|
LABEL maintainer="Nicola"
|
|
LABEL description="Nicotine+ with noVNC web interface and SSH X forwarding support"
|
|
LABEL version="1.0"
|
|
|
|
# Avoid interactive prompts
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Environment variables
|
|
ENV DISPLAY=:0 \
|
|
VNC_PORT=5900 \
|
|
NOVNC_PORT=6080 \
|
|
VNC_RESOLUTION=1280x720 \
|
|
VNC_DEPTH=24 \
|
|
USER=nicotine \
|
|
PUID=1000 \
|
|
PGID=1000 \
|
|
NOVNC_VERSION=1.3.0
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Lightweight window manager
|
|
openbox \
|
|
dbus-x11 \
|
|
# VNC server
|
|
tigervnc-standalone-server \
|
|
tigervnc-common \
|
|
tigervnc-tools \
|
|
python3-websockify \
|
|
# Nicotine+ dependencies
|
|
python3 \
|
|
python3-pip \
|
|
python3-gi \
|
|
python3-gi-cairo \
|
|
gir1.2-gtk-3.0 \
|
|
# Supervisord to manage processes
|
|
supervisor \
|
|
# Emoji font support
|
|
fonts-noto-color-emoji \
|
|
# TLS certificates for pip
|
|
ca-certificates \
|
|
# Download tools for noVNC static bundle
|
|
curl \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install noVNC static files (no Node.js dependency)
|
|
RUN mkdir -p /usr/share/novnc \
|
|
&& curl -fsSL "https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.tar.gz" \
|
|
| tar -xz --strip-components=1 -C /usr/share/novnc \
|
|
&& rm -rf /usr/share/novnc/utils/websockify \
|
|
&& apt-get purge -y --auto-remove curl \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Nicotine+ latest version
|
|
RUN pip3 install --no-cache-dir --break-system-packages nicotine-plus
|
|
|
|
# Create non-root user
|
|
RUN groupadd -g ${PGID} ${USER} && \
|
|
useradd -u ${PUID} -g ${PGID} -m -s /bin/bash ${USER}
|
|
|
|
# Create directories
|
|
RUN mkdir -p \
|
|
/config \
|
|
/downloads \
|
|
/incomplete \
|
|
/home/${USER}/.config/openbox \
|
|
/home/${USER}/.config/nicotine \
|
|
/home/${USER}/.vnc \
|
|
/var/log/supervisor
|
|
|
|
# Copy configurations
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
COPY openbox-rc.xml /home/${USER}/.config/openbox/rc.xml
|
|
COPY index.html /usr/share/novnc/index.html
|
|
COPY vnc-patched.html /usr/share/novnc/vnc.html
|
|
COPY vnc-clipboard-bridge.js /usr/share/novnc/vnc-clipboard-bridge.js
|
|
COPY log-prefix.sh /usr/local/bin/log-prefix.sh
|
|
|
|
# Set permissions
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/log-prefix.sh \
|
|
&& chown -R ${USER}:${USER} /home/${USER} /config /downloads /incomplete
|
|
|
|
# Expose noVNC and Soulseek ports
|
|
EXPOSE 6080 2234 2235/udp
|
|
|
|
# Volumes
|
|
VOLUME ["/config", "/downloads", "/incomplete"]
|
|
|
|
WORKDIR /home/${USER}
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|