FROM node:20-slim ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends \ curl ca-certificates sudo \ # ── Discord runtime deps ────────────────── libatomic1 libnotify4 libnspr4 libnss3 libxss1 libgbm1 \ libgconf-2-4 libxtst6 libgtk-3-0 \ # ── GUI / audio / misc ─────────────────── xvfb pulseaudio openbox \ tigervnc-standalone-server tigervnc-common fonts-liberation \ x11vnc \ # ── Audio processing for voice recording ── ffmpeg libopus0 libopus-dev \ # ── Encryption and build tools for video recording ── libsodium23 libsodium-dev build-essential libtool autoconf \ && rm -rf /var/lib/apt/lists/* # --- DOWNLOAD DISCORD AS ROOT --- WORKDIR /opt/preinstall RUN curl -L https://discord.com/api/download/stable?platform=linux -o discord.deb && \ dpkg -i discord.deb || apt-get -f install -y RUN useradd --create-home --shell /bin/bash bot && \ adduser bot sudo && \ echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /opt/bot COPY package*.json ./ RUN npm install --no-audit --no-fund COPY . . RUN chmod +x /opt/bot/entry.sh RUN chown -R bot:bot /opt/bot USER bot ENV DISPLAY=:99 RUN mkdir -p /run/dbus ENTRYPOINT dbus-daemon --system --fork --nofork --address unix:/run/dbus/system_bus_socket & exec /opt/bot/entry.sh "$@"