Skip to content

Commit

Permalink
feat: testing new s6 v3 startup scripts and new custom image
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloromeo committed Jul 23, 2024
1 parent 5667124 commit c5acc0e
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/with-contenv bash

if which node > /dev/null
then
echo "**** node is installed, skipping... ****"
else
echo "**** install runtime packages ****"
echo "**** apt-get update ****"
apt-get update
echo "**** install libatomic1, file, nginx ****"
apt-get install -y libatomic1 file nginx
echo "**** install 'n' ****"
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n
echo "**** install nodejs ****"
bash n lts
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/1-install-dependencies/run
5 changes: 5 additions & 0 deletions pms/docker-mod/root/etc/s6-overlay/s6-rc.d/2-npm-install/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash

echo "**** Running npm install ****"
cd /app
npm install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/2-npm-install/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bash

if file /usr/lib/plexmediaserver/'Plex Transcoder' | grep -iq ASCII ; then
echo "**** Transcoder is already clusterplex, only update ****"
else
echo "**** Transcoder is still original, rename ****"
mv /usr/lib/plexmediaserver/'Plex Transcoder' /usr/lib/plexmediaserver/originalTranscoder
fi

echo "**** Move shim to destination ****"
cp /app/transcoder-shim.sh /usr/lib/plexmediaserver/'Plex Transcoder'

echo "**** Make the shim executable ****"
chmod +x /usr/lib/plexmediaserver/'Plex Transcoder'

echo "**** Make sentinel.sh executable ****"
chmod +x /app/sentinel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/3-install-transcoder-shim/run
15 changes: 15 additions & 0 deletions pms/docker-mod/root/etc/s6-overlay/s6-rc.d/4-setup-nginx/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/with-contenv bash

echo "**** unlink nginx default ****"
unlink /etc/nginx/sites-enabled/default
echo "**** link nginx forward-proxy ****"
ln -s /etc/nginx/sites-available/forward-proxy.conf /etc/nginx/sites-enabled/forward-proxy.conf

echo "**** configuring nginx (for Local Relay) forwarding ports ****"
echo "PMS_PORT => '${PMS_PORT}'"
echo "LOCAL_RELAY_PORT => '${LOCAL_RELAY_PORT}'"

sed -i 's/_PMS_PORT/'"${PMS_PORT:-32400}"'/g' /etc/nginx/sites-available/forward-proxy.conf
sed -i 's/_LOCAL_RELAY_PORT/'"${LOCAL_RELAY_PORT:-32499}"'/g' /etc/nginx/sites-available/forward-proxy.conf

echo "**** nginx configuration complete ****"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/4-setup-nginx/run
Empty file.
Empty file.
Empty file.
Empty file.
16 changes: 9 additions & 7 deletions pms/extended-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ LABEL maintainer="pabloromeo"
COPY /docker-mod/root/etc/ /etc/
COPY /app /app

RUN bash /etc/cont-init.d/92-install-dependencies && \
bash /etc/cont-init.d/93-npm-install && \
rm /etc/cont-init.d/92-install-dependencies && \
rm /etc/cont-init.d/93-npm-install && \
RUN bash /etc/s6-overlay/s6-rc.d/1-install-dependencies/run && \
bash /etc/s6-overlay/s6-rc.d/2-npm-install/run && \
rm -rf /etc/s6-overlay/s6-rc.d/1-install-dependencies && \
rm -rf /etc/s6-overlay/s6-rc.d/2-npm-install && \
rm /etc/s6-overlay/s6-rc.d/user/contents.d/1-install-dependencies && \
rm /etc/s6-overlay/s6-rc.d/user/contents.d/2-npm-install && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

WORKDIR /

0 comments on commit c5acc0e

Please sign in to comment.