56 lines
3.2 KiB
Docker
56 lines
3.2 KiB
Docker
FROM jrei/systemd-ubuntu:20.04
|
|
|
|
RUN apt update && \
|
|
apt upgrade -y && \
|
|
apt-get -y install curl wget sudo cron net-tools iproute2 vim && \
|
|
cd /root && \
|
|
curl -sL -o /etc/apt/trusted.gpg.d/morph027-janus.asc https://packaging.gitlab.io/janus/gpg.key && \
|
|
. /etc/lsb-release; echo "deb [arch=amd64] https://packaging.gitlab.io/janus/$DISTRIB_CODENAME $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/morph027-janus.list && \
|
|
apt update && \
|
|
echo "cron exists" #ln -s /lib/systemd/system/cron.service /etc/systemd/system/multi-user.target.wants/cron.service
|
|
|
|
RUN echo "READY" && \
|
|
mkdir -p /var/spool/cron/crontabs/ && \
|
|
(crontab -l 2>/dev/null; echo '@reboot /usr/local/bin/initserver.sh >> /tmp/init.log 2>&1') | crontab -
|
|
|
|
RUN cd /root && \
|
|
apt install janus -y && \
|
|
curl -sL -o /etc/apt/trusted.gpg.d/morph027-nats-server.asc https://packaging.gitlab.io/nats-server/gpg.key && \
|
|
echo "deb [arch=amd64] https://packaging.gitlab.io/nats-server nats main" | tee /etc/apt/sources.list.d/morph027-nats-server.list && \
|
|
apt update && \
|
|
apt install nats-server -y && \
|
|
install -d -o nats -g nats /etc/nats && \
|
|
sudo -u nats echo "listen: 127.0.0.1:4222" > /etc/nats/nats.conf && \
|
|
echo "Janus exists" #ln -s /lib/systemd/system/janus.service /etc/systemd/system/multi-user.target.wants/janus.service && \
|
|
ln -s /lib/systemd/system/nats-server.service /etc/systemd/system/multi-user.target.wants/nats-server.service
|
|
|
|
RUN cd /root && \
|
|
apt install git automake golang build-essential python3 -y && \
|
|
cd /opt && \
|
|
git clone https://github.com/strukturag/nextcloud-spreed-signaling.git && \
|
|
cd nextcloud-spreed-signaling/ && \
|
|
make build && \
|
|
cp bin/signaling /usr/bin/ && \
|
|
useradd --system --shell /usr/sbin/nologin --comment "Standalone signaling server for Nextcloud Talk" signaling && \
|
|
mkdir /etc/signaling/ && \
|
|
touch /etc/signaling/server.conf && \
|
|
wget https://git.dre.ist/marcus/nextcloud-hpb/raw/branch/main/src/signaling/server.conf -O /etc/signaling/server.conf && \
|
|
chmod 600 /etc/signaling/server.conf && \
|
|
chown signaling: /etc/signaling/server.conf && \
|
|
cp /opt/nextcloud-spreed-signaling/dist/init/systemd/signaling.service /lib/systemd/system/signaling.service && \
|
|
wget https://git.dre.ist/marcus/nextcloud-hpb/raw/branch/main/src/janus/janus.jcfg -O /etc/janus/janus.jcfg && \
|
|
ln -s /lib/systemd/system/signaling.service /etc/systemd/system/multi-user.target.wants/signaling.service
|
|
|
|
RUN cd /root && \
|
|
apt install coturn -y && \
|
|
sed -i '/TURNSERVER_ENABLED/c\TURNSERVER_ENABLED=1' /etc/default/coturn && \
|
|
wget https://git.dre.ist/marcus/nextcloud-hpb/raw/branch/main/src/coturn/turnserver.conf -O /etc/turnserver.conf && \
|
|
echo "Coturn exists" #ln -s /lib/systemd/system/coturn.service /etc/systemd/system/multi-user.target.wants/coturn.service
|
|
|
|
RUN cd /root && \
|
|
wget https://git.dre.ist/marcus/nextcloud-hpb/raw/branch/main/src/initserver.sh -O /usr/local/bin/initserver.sh && \
|
|
wget https://git.dre.ist/marcus/nextcloud-hpb/raw/branch/main/src/onboot.sh -O /usr/local/bin/onboot.sh && \
|
|
chmod +x /usr/local/bin/initserver.sh /usr/local/bin/onboot.sh
|
|
|
|
ENTRYPOINT ["/usr/local/bin/onboot.sh"]
|