Compare commits

..

1 Commits

Author SHA1 Message Date
Ween Jiann
8ef0df3d41 Check init via tinker (#381) 2021-07-10 02:43:43 +08:00
3 changed files with 4 additions and 9 deletions

View File

@@ -21,9 +21,9 @@ WORKDIR /var/www/app/
# Install node packages
ARG BAK_STORAGE_PATH
ARG BAK_PUBLIC_PATH
RUN npm install --production \
RUN --mount=target=/var/www/app/node_modules,type=cache \
npm install --production \
&& npm run production \
&& rm -rf node_modules \
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
&& mv /var/www/app/public $BAK_PUBLIC_PATH

View File

@@ -65,11 +65,6 @@ if [ -d "$BAK_STORAGE_PATH" ]; then
rm -rf "$BAK_STORAGE_PATH"
fi
# prevent init scripts from running when upgrading from IN <= 5.1.62
if [ -f /var/www/app/public/version ] && [ "$INVOICENINJA_VERSION" != "$(cat /var/www/app/public/version)" ]; then
touch /var/www/app/storage/.initialized
fi
# create public volume
if [ -d "$BAK_PUBLIC_PATH" ]; then
if [ ! -d /var/www/app/public ]; then

View File

@@ -38,7 +38,7 @@ fi
php artisan migrate --force
# If first IN run, it needs to be initialized
if [ ! -f /var/www/app/storage/.initialized ]; then
IN_INIT=$(php artisan tinker --execute='echo Schema::hasTable("accounts") && !App\Models\Account::all()->first();')
if [ "$IN_INIT" == "1" ]; then
docker_process_init_files /docker-entrypoint-init.d/*
touch /var/www/app/storage/.initialized
fi