update init procedure
This commit is contained in:
parent
2bed1a8222
commit
57c5a7db61
3 changed files with 7 additions and 15 deletions
|
|
@ -17,22 +17,9 @@ spec:
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: registry-credentials
|
- name: registry-credentials
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: pleroma-static-files
|
- name: pleroma-init
|
||||||
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
||||||
command: [ "sh", "-c", "mkdir -p ${DATA}/uploads && mkdir -p ${DATA}/static && cp -rf /static-files/* ${DATA}/static && chown -R 1000:1000 /var/lib/pleroma" ]
|
command: [ "/init-pleroma.sh" ]
|
||||||
- name: pleroma-database-wait
|
|
||||||
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
|
||||||
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
|
|
||||||
- name: pleroma-migrate
|
|
||||||
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
|
||||||
command: [ "sh", "-c", "exec", "${HOME}/bin/pleroma_ctl migrate" ]
|
|
||||||
containers:
|
containers:
|
||||||
- name: pleroma
|
- name: pleroma
|
||||||
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
image: cr.forge.lan/darkdork-dev/pleroma:${CI_COMMIT_SHA}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ RUN rm -r /tmp/release
|
||||||
RUN rm /tmp/pleroma.zip
|
RUN rm /tmp/pleroma.zip
|
||||||
|
|
||||||
COPY --chmod=0764 --chown=pleroma:pleroma ./static-files/ /static-files/
|
COPY --chmod=0764 --chown=pleroma:pleroma ./static-files/ /static-files/
|
||||||
|
COPY --chmod=0755 --chown=pleroma:pleroma ./init-pleroma.sh /
|
||||||
COPY --chmod=0755 --chown=pleroma:pleroma ./docker-entrypoint.sh ${HOME}
|
COPY --chmod=0755 --chown=pleroma:pleroma ./docker-entrypoint.sh ${HOME}
|
||||||
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|
|
||||||
4
pleroma/init-pleroma.sh
Normal file
4
pleroma/init-pleroma.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
while ! pg_isready -U ${DB_USER} -d postgres://${DB_HOST}:${DB_PORT}/${DB_NAME} -t 1; do sleep 1s; done;
|
||||||
|
mkdir -p ${DATA}/uploads && mkdir -p ${DATA}/static && cp -rf /static-files/* ${DATA}/static && chown -R 1000:1000 ${DATA}
|
||||||
|
exec "${HOME}/bin/pleroma_ctl migrate"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue