63 líneas
1.4 KiB
Docker
63 líneas
1.4 KiB
Docker
# Base image with Ubuntu
|
|
FROM ubuntu:22.04
|
|
|
|
# Avoid prompts from apt
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install dependencies for Discord and X11
|
|
RUN apt-get update && apt-get install -y \
|
|
wget \
|
|
gnupg2 \
|
|
ca-certificates \
|
|
libgtk-3-0 \
|
|
libnotify4 \
|
|
libnss3 \
|
|
libxss1 \
|
|
libxtst6 \
|
|
xdg-utils \
|
|
libatspi2.0-0 \
|
|
libuuid1 \
|
|
libappindicator3-1 \
|
|
libsecret-1-0 \
|
|
libgbm1 \
|
|
libasound2 \
|
|
libdrm2 \
|
|
libxshmfence1 \
|
|
x11-apps \
|
|
pulseaudio \
|
|
libatomic1 \
|
|
fonts-noto-color-emoji \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create a non-root user to run Discord
|
|
RUN useradd -m -s /bin/bash discord && \
|
|
mkdir -p /home/discord/.config
|
|
|
|
# Copy the Discord .deb package
|
|
RUN wget -O /tmp/discord.deb "https://discord.com/api/download?platform=linux&format=deb"
|
|
|
|
# Install Discord
|
|
RUN dpkg -i /tmp/discord.deb && \
|
|
apt-get update && \
|
|
apt-get -f install -y && \
|
|
rm /tmp/discord.deb && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up user permissions
|
|
RUN chown -R discord:discord /home/discord
|
|
|
|
# Switch to non-root user
|
|
USER discord
|
|
WORKDIR /home/discord
|
|
|
|
# Set environment variables for X11
|
|
ENV DISPLAY=:0
|
|
ENV QT_X11_NO_MITSHM=1
|
|
|
|
# Copy entrypoint script
|
|
COPY --chown=discord:discord entrypoint.sh /home/discord/entrypoint.sh
|
|
RUN chmod +x /home/discord/entrypoint.sh
|
|
|
|
# Start Discord
|
|
ENTRYPOINT ["/home/discord/entrypoint.sh"]
|