mirror of https://github.com/icedream/ts3bot.git
Merge pull request #3 from icedream/space
Layer optimization by moving build instructions into a scriptcapabilities
commit
8337436e77
57
Dockerfile
57
Dockerfile
|
@ -1,63 +1,14 @@
|
||||||
FROM phusion/passenger-nodejs:0.9.17
|
FROM phusion/passenger-nodejs:0.9.17
|
||||||
|
|
||||||
# get rid of useless services
|
|
||||||
RUN rm -r /etc/service/cron /etc/service/nginx /etc/service/nginx-log-forwarder
|
|
||||||
|
|
||||||
# prepare APT with only the repositories we want
|
|
||||||
RUN rm /etc/apt/sources.list.d/* &&\
|
|
||||||
add-apt-repository ppa:mc3man/trusty-media -y &&\
|
|
||||||
DEBIAN_FRONTEND=noninteractive curl -sL https://deb.nodesource.com/setup_4.x | bash - &&\
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
||||||
nodejs \
|
|
||||||
blackbox xvfb xdotool \
|
|
||||||
pulseaudio pulseaudio-utils \
|
|
||||||
dbus \
|
|
||||||
python python-minimal python-pkg-resources rtmpdump ffmpeg \
|
|
||||||
vlc vlc-plugin-pulse
|
|
||||||
|
|
||||||
# initialize DBus
|
|
||||||
RUN mkdir -p /var/run/dbus && \
|
|
||||||
chown messagebus:messagebus /var/run/dbus && \
|
|
||||||
dbus-uuidgen --ensure
|
|
||||||
|
|
||||||
# configure gui user
|
|
||||||
RUN mkdir -p /config &&\
|
|
||||||
ln -sf /config ~app/.ts3bot
|
|
||||||
|
|
||||||
# install teamspeak3
|
|
||||||
# Original comment that used to be here: temporary non-interactive teamspeak3 install hack, remove before publishing!!
|
|
||||||
# In fact, it would be nice if we had some lazy handling code for this that just requires the user to provide a "--agree-with-license" once.
|
|
||||||
ENV TS3CLIENT_VERSION 3.0.18.2
|
ENV TS3CLIENT_VERSION 3.0.18.2
|
||||||
ADD http://dl.4players.de/ts/releases/${TS3CLIENT_VERSION}/TeamSpeak3-Client-linux_amd64-${TS3CLIENT_VERSION}.run /home/app/ts3client.run
|
|
||||||
WORKDIR /home/app
|
|
||||||
RUN chmod +x ./ts3client.run &&\
|
|
||||||
sed -i 's/^MS_PrintLicense$/#MS_PrintLicense/g' ./ts3client.run &&\
|
|
||||||
./ts3client.run --quiet --target ts3client &&\
|
|
||||||
rm ./ts3client.run
|
|
||||||
USER root
|
|
||||||
|
|
||||||
# install the ts3bot-control app properly
|
|
||||||
ENV TS3BOT_COMMIT 1892b56e4cffc583e7faa1ca7fe7cf2534b30c1b
|
ENV TS3BOT_COMMIT 1892b56e4cffc583e7faa1ca7fe7cf2534b30c1b
|
||||||
ADD https://github.com/icedream/ts3bot-control/archive/${TS3BOT_COMMIT}.tar.gz /home/app/ts3bot-control.tgz
|
|
||||||
WORKDIR /home/app
|
|
||||||
RUN tar xvf ts3bot-control.tgz &&\
|
|
||||||
rm ts3bot-control.tgz &&\
|
|
||||||
mv ts3bot-control* ts3bot
|
|
||||||
WORKDIR /home/app/ts3bot
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
# install youtube-dl
|
ADD setup.sh /
|
||||||
ADD https://yt-dl.org/latest/youtube-dl /usr/local/bin/youtube-dl
|
RUN sh /setup.sh
|
||||||
RUN chmod a+rx /usr/local/bin/youtube-dl
|
|
||||||
|
|
||||||
# initialize other configuration for daemons
|
# Copy over configuration for other daemons
|
||||||
COPY etc/ /etc
|
COPY etc/ /etc
|
||||||
|
|
||||||
# clean up apt
|
# Startup configuration
|
||||||
RUN apt-get clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
||||||
|
|
||||||
VOLUME [ "/home/app/ts3client" ]
|
|
||||||
|
|
||||||
WORKDIR /home/app
|
WORKDIR /home/app
|
||||||
ENTRYPOINT [ "/sbin/my_init" ]
|
ENTRYPOINT [ "/sbin/my_init" ]
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# For non-interactive install (dpkg)
|
||||||
|
export INITRD=no
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Get rid of some preinstalled services we don't need
|
||||||
|
rm -r /etc/service/cron /etc/service/nginx /etc/service/nginx-log-forwarder
|
||||||
|
|
||||||
|
# Set up APT sources
|
||||||
|
rm /etc/apt/sources.list.d/*
|
||||||
|
add-apt-repository ppa:mc3man/trusty-media -y
|
||||||
|
|
||||||
|
# Now install all packages we need
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
wget ca-certificates \
|
||||||
|
blackbox xvfb xdotool \
|
||||||
|
pulseaudio pulseaudio-utils \
|
||||||
|
dbus \
|
||||||
|
python python-minimal python-pkg-resources rtmpdump ffmpeg \
|
||||||
|
vlc vlc-plugin-pulse
|
||||||
|
|
||||||
|
# DBus initialization
|
||||||
|
mkdir -p /var/run/dbus
|
||||||
|
chown messagebus:messagebus /var/run/dbus
|
||||||
|
dbus-uuidgen --ensure
|
||||||
|
|
||||||
|
# Configure GUI user, we are going to use the pre-setup "app" user for this
|
||||||
|
mkdir -p /config
|
||||||
|
/sbin/setuser app ln -sf /config ~app/.ts3bot
|
||||||
|
|
||||||
|
# Install TeamSpeak3.
|
||||||
|
# Original comment that used to be here: temporary non-interactive teamspeak3 install hack, remove before publishing!!
|
||||||
|
# In fact, it would be nice if we had some lazy handling code for this that just requires the user to provide a "--agree-with-license" once.
|
||||||
|
cd ~app
|
||||||
|
/sbin/setuser app wget http://dl.4players.de/ts/releases/${TS3CLIENT_VERSION}/TeamSpeak3-Client-linux_amd64-${TS3CLIENT_VERSION}.run -Ots3client.run
|
||||||
|
chmod +x ./ts3client.run
|
||||||
|
sed -i 's/^MS_PrintLicense$/#MS_PrintLicense/g' ./ts3client.run
|
||||||
|
/sbin/setuser app ./ts3client.run --quiet --target ts3client
|
||||||
|
rm ./ts3client.run
|
||||||
|
|
||||||
|
# Install TS3Bot
|
||||||
|
wget https://github.com/icedream/ts3bot-control/archive/${TS3BOT_COMMIT}.tar.gz -O- |\
|
||||||
|
/sbin/setuser app tar xzv
|
||||||
|
mv ts3bot-control* ts3bot
|
||||||
|
(cd ts3bot && /sbin/setuser app npm install)
|
||||||
|
|
||||||
|
# Install youtube-dl (actually done by npm already in a non-system-wide way)
|
||||||
|
#ADD https://yt-dl.org/latest/youtube-dl /usr/local/bin/youtube-dl
|
||||||
|
#RUN chmod a+rx /usr/local/bin/youtube-dl
|
||||||
|
|
||||||
|
# Clean up APT
|
||||||
|
apt-get autoremove -y --purge wget
|
||||||
|
apt-get clean
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
Loading…
Reference in New Issue