M entrypoint.sh => entrypoint.sh +9 -2
@@ 24,8 24,15 @@ if [ ! -d /data/postgres ]; then
while ! pg_isready; do
sleep 1
done
- su postgres -c 'psql -c "CREATE ROLE pleroma LOGIN"'
- su postgres -c 'psql -c "CREATE DATABASE pleroma WITH OWNER pleroma"'
+ runuser -u postgres -- psql -c "CREATE ROLE pleroma LOGIN"
+ runuser -u postgres -- psql -c "CREATE DATABASE pleroma WITH OWNER pleroma"
+
+ while [ ! -f /tmp/.pleroma-ever-started ]; do
+ sleep 1
+ done
+
+ runuser -u pleroma -- /opt/pleroma/bin/pleroma_ctl config migrate_to_db
+ echo "config :pleroma, configurable_from_database: true" >> /data/pleroma/config.exs
) &
fi
M start_pleroma.sh => start_pleroma.sh +1 -0
@@ 14,4 14,5 @@ echo "-- Running migrations..."
/opt/pleroma/bin/pleroma_ctl migrate
echo "-- Starting!"
+touch /tmp/.pleroma-ever-started
exec /opt/pleroma/bin/pleroma start