Skip to content

Commit

Permalink
update Sinusbot image
Browse files Browse the repository at this point in the history
  • Loading branch information
gOOvER committed Mar 9, 2024
1 parent c67a3cf commit 317c2cf
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 9 deletions.
50 changes: 43 additions & 7 deletions bots/sinusbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,54 @@ ENV DEBIAN_FRONTEND noninteractive
# Install Dependencies
RUN apt update \
&& apt upgrade -y \
&& apt install -y ca-certificates less locales pulseaudio python3 sudo x11vnc x11-xkb-utils xvfb iproute2 ffmpeg curl \
libasound2 libegl1-mesa libglib2.0-0 libnss3 libpci3 libpulse0 libxcursor1 libxslt1.1 libx11-xcb1 libxkbcommon0 \
&& useradd -m -d /home/container container
&& apt install -y \
ca-certificates \
less \
locales \
pulseaudio \
python3 \
sudo \
x11vnc \
x11-xkb-utils \
xvfb \
iproute2 \
ffmpeg \
curl \
libasound2 \
libegl1-mesa \
libglib2.0-0 \
libnss3 \
libpci3 \
libpulse0 \
libxcursor1 \
libxslt1.1 \
libx11-xcb1 \
libxkbcommon0 \
tini

RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl \
&& chmod a+rx /usr/local/bin/youtube-dl
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
&& chmod a+rx /usr/local/bin/youtube-dl

USER container
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

# Sets the default stop signal as wings can (currently) only send a kill or generic stop
STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]

COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]
28 changes: 26 additions & 2 deletions bots/sinusbot/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
#!/bin/bash
cd /home/container
#System variables
clear
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'

# Switch to the container's working directory
cd /home/container || exit 1

# Wait for the container to fully initialize
sleep 1

# Default the TZ environment variable to UTC.
TZ=${TZ:-UTC}
export TZ

# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP

# system informations
echo -e "${BLUE}-------------------------------------------------${NC}"
echo -e "${RED}Sinusbot Image by gOOvER${NC}"
echo -e "${BLUE}-------------------------------------------------${NC}"
echo -e "${YELLOW}Running on Debian: ${RED} $(cat /etc/debian_version)${NC}"
echo -e "${YELLOW}Current timezone: ${RED} $(cat /etc/timezone)${NC}"
echo -e "${BLUE}-------------------------------------------------${NC}"

# Replace Startup Variables
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo ":/home/container$ ${MODIFIED_STARTUP}"

# Run the Server
Expand Down

0 comments on commit 317c2cf

Please sign in to comment.