Change location

This commit is contained in:
Alexandre
2022-07-09 20:12:45 +02:00
committed by GitHub
parent 845cb5e356
commit aaa0d97ffa

View File

@@ -30,11 +30,13 @@ VOLUME [ "/data" ]
#USER root
ENV FROM_EMAIL='wger Workout Manager <wger@example.com>'
ENV LOCATION=/config/addons_config/wger
RUN sed -i "1a python3 manage.py migrate || true" /home/wger/entrypoint.sh \
&& sed -i "1a ln -s /data/database.sqlite /home/wger/db" /home/wger/entrypoint.sh \
&& sed -i "1a ln -s $LOCATION/database.sqlite /home/wger/db" /home/wger/entrypoint.sh \
&& sed -i "1a if [ -f /data/database.sqlite ]; then mv -f /data/database.sqlite $LOCATION/database.sqlite; fi" /home/wger/entrypoint.sh \
&& sed -i "1a rm /home/wger/db/database.sqlite &>/dev/null || true" /home/wger/entrypoint.sh \
&& sed -i "1a touch /data/database.sqlite || true && chown -R wger /data || true && chmod -R 777 /data || true" /home/wger/entrypoint.sh
&& sed -i "1a mkdir -p $LOCATION && touch $LOCATION/database.sqlite || true && chown -R wger $LOCATION || true && chmod -R 777 $LOCATION || true" /home/wger/entrypoint.sh
##################
# 3 Install apps #