Update docker

This commit is contained in:
david 2025-05-16 18:01:29 +02:00
parent b756df38a9
commit 4c31dbbed0
7 changed files with 441 additions and 230 deletions

View file

@ -1,8 +1,24 @@
#!/bin/bash -e
echo "entrypoint docker: ${@} ${ASSETS_PATH} :: ${@: 1:1} / ${@: 2:1}"
# If running the rails server then create or migrate existing database
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
if [ "${@: 1:1}" == "./bin/rails" ] && [ "${@: 2:1}" == "server" ]; then
if [ -f ${INSTALL_DIR}/pids/server.pid ]; then
rm ${INSTALL_DIR}/pids/server.pid
fi
echo "Prepare db..."
./bin/rails db:prepare
echo "Copy assets to <$ASSETS_PATH>?"
if [[ -n "$ASSETS_PATH" ]]; then
echo "Copy assets to $ASSETS_PATH"
find "$INSTALL_DIR/public" -mindepth 1 -exec echo "copy " {} \;
find "$INSTALL_DIR/public" -mindepth 1 -exec cp -a {} "$ASSETS_PATH" \;
fi
fi
exec "${@}"