move database ready check into init container
This commit is contained in:
parent
64dc13b3ad
commit
ea4bd5e94d
2 changed files with 12 additions and 3 deletions
|
|
@ -45,6 +45,17 @@ spec:
|
|||
spec:
|
||||
imagePullSecrets:
|
||||
- name: registry-credentials
|
||||
initContainers:
|
||||
- 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;"]
|
||||
env:
|
||||
- name: DB_HOST
|
||||
value: postgres
|
||||
- name: DB_NAME
|
||||
value: pleroma
|
||||
- name: DB_USER
|
||||
value: pleroma
|
||||
containers:
|
||||
- name: pleroma
|
||||
image: cr.forge.lan/darkdork-dev/pleroma
|
||||
|
|
|
|||
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
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 "-- Waiting for database..."
|
||||
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-pleroma} -t 1; do sleep 1s; done;
|
||||
echo $DB_PASSWORD
|
||||
echo "-- Running migrations..."
|
||||
$HOME/bin/pleroma_ctl migrate
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue