mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-02-02 04:07:10 +01:00
Check init via tinker (#381)
This commit is contained in:
@@ -21,9 +21,9 @@ WORKDIR /var/www/app/
|
|||||||
# Install node packages
|
# Install node packages
|
||||||
ARG BAK_STORAGE_PATH
|
ARG BAK_STORAGE_PATH
|
||||||
ARG BAK_PUBLIC_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 \
|
&& npm run production \
|
||||||
&& rm -rf node_modules \
|
|
||||||
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
&& mv /var/www/app/storage $BAK_STORAGE_PATH \
|
||||||
&& mv /var/www/app/public $BAK_PUBLIC_PATH
|
&& mv /var/www/app/public $BAK_PUBLIC_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -65,11 +65,6 @@ if [ -d "$BAK_STORAGE_PATH" ]; then
|
|||||||
rm -rf "$BAK_STORAGE_PATH"
|
rm -rf "$BAK_STORAGE_PATH"
|
||||||
fi
|
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
|
# create public volume
|
||||||
if [ -d "$BAK_PUBLIC_PATH" ]; then
|
if [ -d "$BAK_PUBLIC_PATH" ]; then
|
||||||
if [ ! -d /var/www/app/public ]; then
|
if [ ! -d /var/www/app/public ]; then
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ fi
|
|||||||
php artisan migrate --force
|
php artisan migrate --force
|
||||||
|
|
||||||
# If first IN run, it needs to be initialized
|
# 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/*
|
docker_process_init_files /docker-entrypoint-init.d/*
|
||||||
touch /var/www/app/storage/.initialized
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user