2022-05-04 11:57:40 -06:00
|
|
|
#!/bin/bash
|
|
|
|
export SHELL="/bin/bash"
|
|
|
|
FILE='/configured.txt'
|
|
|
|
|
|
|
|
# Start the instance to verify that everything is working as expected
|
|
|
|
|
|
|
|
#Set Permissions
|
2022-05-04 12:16:39 -06:00
|
|
|
chown -R pleroma:pleroma /var/lib/pleroma
|
2022-05-04 11:57:40 -06:00
|
|
|
chmod -R 777 /saves
|
|
|
|
|
|
|
|
#Configure Local Time
|
|
|
|
cp -f /usr/share/zoneinfo/US/Mountain /etc/localtime
|
|
|
|
|
|
|
|
#Start Cron and Postgresql
|
|
|
|
crond
|
|
|
|
|
|
|
|
#Configure and start Nginx
|
|
|
|
mkdir -p /run/nginx
|
|
|
|
nginx
|
|
|
|
|
|
|
|
#Start Pleroma
|
|
|
|
if [ ! -f "$FILE" ]
|
|
|
|
then
|
|
|
|
su postgres -s $SHELL -lc "/usr/lib/postgresql/14/bin/pg_ctl start -D /var/lib/postgresql/data"
|
2022-05-04 12:16:39 -06:00
|
|
|
cd /opt/pleroma
|
2022-05-04 12:14:28 -06:00
|
|
|
su pleroma -s /bin/bash -lc 'MIX_ENV=prod mix phx.server'
|
2022-05-04 11:57:40 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
tail -f /dev/null
|
|
|
|
|