move migrate and static file setup to init container from docker entrypoint

This commit is contained in:
red 2025-03-11 09:12:33 -04:00
parent e47a77a32e
commit 17ef031e43
3 changed files with 25 additions and 10 deletions

View file

@ -46,9 +46,15 @@ spec:
imagePullSecrets:
- name: registry-credentials
initContainers:
- name: pleroma-static-files
image: cr.forge.lan/darkdork-dev/pleroma
command: [ "sh", "-c", "mkdir -p ${DATA}/uploads && mkdir -p ${DATA}/static && cp -rf /static-files/* ${DATA}/static" ]
- name: pleroma-migrate
image: cr.forge.lan/darkdork-dev/pleroma
command: [ "sh", "-c", "$HOME/bin/pleroma_ctl migrate" ]
- name: pleroma-database-wait
image: cr.forge.lan/darkdork-dev/pleroma
command: ["sh", "-c", "while ! pg_isready -U ${DB_USER} -d postgres://${DB_HOST}:${DB_PORT}/${DB_NAME} -t 1; do sleep 1s; done;"]
command: [ "sh", "-c", "while ! pg_isready -U ${DB_USER} -d postgres://${DB_HOST}:${DB_PORT}/${DB_NAME} -t 1; do sleep 1s; done;" ]
env:
- name: DB_HOST
value: postgres

View file

@ -2,12 +2,5 @@
set -e
# Move the files that were built into the image into the directory they will be served from
mkdir -p ${DATA}/uploads && mkdir -p ${DATA}/static
cp -rf /static-files/* ${DATA}/static
echo "-- Running migrations..."
$HOME/bin/pleroma_ctl migrate
echo "-- Starting!"
exec $HOME/bin/pleroma start

View file

@ -20,7 +20,9 @@ config :pleroma, :instance,
invites_enabled: true,
healthcheck: true
config :pleroma, :http, proxy_url: {:socks5h, "10.8.1.1", 1080}
config :pleroma, :http,
proxy_url: { :socks5, {10, 8, 0, 1}, 1080 }
config :pleroma, :media_proxy,
enabled: false,
@ -75,3 +77,17 @@ config :joken, default_signer: System.get_env("DEFAULT_SIGNER")
config :pleroma, configurable_from_database: false
config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool.StripLocation, Pleroma.Upload.Filter.Dedupe]
config :pleroma, :mrf,
policies: [
Pleroma.Web.ActivityPub.MRF.SimplePolicy,
Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy,
Pleroma.Web.ActivityPub.MRF.TagPolicy,
Pleroma.Web.ActivityPub.MRF.InlineQuotePolicy,
Pleroma.Web.ActivityPub.MRF.HashtagPolicy
]
config :pleroma, :mrf_simple,
media_removal: [
"varishangout.net"
]