This commit is contained in:
Your Name 2021-11-02 13:23:15 -06:00
parent 3727cfaca4
commit 309897cfb0
6 changed files with 18 additions and 34 deletions

View File

@ -1,23 +1,21 @@
FROM ubuntu:rolling
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update;apt-get install exiftool libmagic-dev software-properties-common cron libncurses6 musl sudo bash curl nginx unzip postgresql-contrib certbot busybox imagemagick ffmpeg -y
RUN add-apt-repository universe;apt-get update
RUN apt-get -y install python3-certbot-nginx
FROM alpine
RUN apk update;apk add bash exiftool libmagic ncurses-libs musl sudo bash curl nginx unzip postgresql postgresql-contrib certbot busybox imagemagick ffmpeg certbot tzdata openssl ncurses
WORKDIR /tmp
ENV SHELL="/bin/bash"
ENV FLAVOUR="amd64"
ENV FLAVOUR="amd64-musl"
RUN adduser --system --shell /bin/false --home /opt/pleroma pleroma
WORKDIR /tmp
RUN su pleroma -s $SHELL -lc "curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=$FLAVOUR' -o /tmp/pleroma.zip;unzip /tmp/pleroma.zip -d /tmp/"
#RUN su pleroma -s $SHELL -lc "curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=$FLAVOUR' -o /tmp/pleroma.zip;unzip /tmp/pleroma.zip -d /tmp/"
#RUN su pleroma -s $SHELL -lc "mv /tmp/release/* /opt/pleroma;rmdir /tmp/release;rm /tmp/pleroma.zip"
RUN su pleroma -s $SHELL -lc "mv /tmp/release/* /opt/pleroma;rmdir /tmp/release;rm /tmp/pleroma.zip"
WORKDIR /opt
COPY pleroma.zip /opt/
RUN mkdir -p /var/lib/pleroma/uploads;chown -R pleroma /var/lib/pleroma
RUN mkdir -p /var/lib/pleroma/static;chown -R pleroma /var/lib/pleroma
WORKDIR /tmp
COPY soapbox-fe.zip /tmp/
RUN mkdir -p /etc/pleroma;chown -R pleroma /etc/pleroma
@ -28,9 +26,6 @@ ADD setup.sh /
ADD crontab /
RUN crontab /crontab
ADD restore.sh /
ADD backup.sh /
ADD terms-of-service.html /tmp/
CMD bash /start.sh

View File

@ -1,3 +0,0 @@
#!/bin/bash
su postgres -s /bin/bash -lc "/usr/lib/postgresql/12/bin/pg_dumpall > /saves/pleroma-`date +%Y-%m-%d-%H-%M`.pgdump"

View File

@ -1,11 +0,0 @@
#!/bin/bash
clear
/etc/init.d/postgresql stop
su postgres -s $SHELL -lc "mkdir /var/lib/postgresql/data;chmod 0700 /var/lib/postgresql/data"
chown -R postgres:postgres /var/lib/postgresql
/etc/init.d/postgresql start
sleep 5
su postgres -s $SHELL -lc "/usr/lib/postgresql/12/bin/psql -f `ls /saves/pleroma* | sort -r | head -1`"
sleep 10
su postgres -s $SHELL -lc "/usr/lib/postgresql/12/bin/vacuumdb --all --analyze-in-stages"

View File

@ -1,6 +1,13 @@
#!/bin/bash
export SHELL="/bin/bash"
cd /opt
unzip pleroma.zip
chown -R pleroma /opt/pleroma
mkdir -p /var/lib/pleroma/uploads
mkdir -p /var/lib/pleroma/static
chown -R pleroma /var/lib/pleroma
sed -i "s/replaceME/${ENDPOINT}/g" /etc/pleroma/config.exs
#Nginx and SSL
@ -19,15 +26,11 @@ su pleroma -s $SHELL -lc "/opt/pleroma/bin/pleroma_ctl migrate"
#su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql --force"
#su postgres -s $SHELL -lc "/usr/lib/postgresql/12/bin/psql -f /tmp/setup_db.psql"
#Create Pleroma Uploads Directory
mkdir /var/lib/pleroma/uploads
chown -R pleroma /var/lib/pleroma/uploads
#Start Pleroma
su pleroma -s $SHELL -lc "/opt/pleroma/bin/pleroma daemon"
#Install Soapbox
curl https://gitlab.com/`curl https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs | grep 'build-production' | cut -d "\"" -f4 | head -1`/artifacts/download -o soapbox-fe.zip
#curl https://gitlab.com/`curl https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs | grep 'build-production' | cut -d "\"" -f4 | head -1`/artifacts/download -o soapbox-fe.zip
#curl -L https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/1734223607/artifacts/download -o soapbox-fe.zip
busybox unzip /tmp/soapbox-fe.zip -o -d /var/lib/pleroma/
mv /var/lib/pleroma/static/instance/about.example /var/lib/pleroma/static/instance/about

BIN
pleroma/soapbox-fe.zip Normal file

Binary file not shown.

View File

@ -12,7 +12,7 @@ chmod -R 777 /saves
cp -f /usr/share/zoneinfo/US/Mountain /etc/localtime
#Start Cron and Postgresql
/etc/init.d/cron start
crond
#Restore latest Database if container is new
if [ ! -f "$FILE" ]