Skip composer scripts during build; defer package:discover to entrypoint
Build container has no .env / runtime config, so post-autoload-dump's package:discover step failed. Run discovery at container start instead.master
parent
87f41387ce
commit
fa84fac440
|
|
@ -38,7 +38,7 @@ COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
COPY --from=code /var/www/html /var/www/html
|
COPY --from=code /var/www/html /var/www/html
|
||||||
|
|
||||||
RUN composer dump-autoload --optimize --no-dev --no-interaction \
|
RUN composer dump-autoload --optimize --no-dev --no-scripts --no-interaction \
|
||||||
&& mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views \
|
&& mkdir -p storage/framework/cache storage/framework/sessions storage/framework/views \
|
||||||
storage/logs storage/app/public bootstrap/cache \
|
storage/logs storage/app/public bootstrap/cache \
|
||||||
&& chown -R www-data:www-data storage bootstrap/cache \
|
&& chown -R www-data:www-data storage bootstrap/cache \
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ mkdir -p storage/framework/cache storage/framework/sessions storage/framework/vi
|
||||||
chmod -R 775 storage bootstrap/cache 2>/dev/null || true
|
chmod -R 775 storage bootstrap/cache 2>/dev/null || true
|
||||||
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
|
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
|
||||||
|
|
||||||
|
# Package discovery (build skipped scripts — run here with real env).
|
||||||
|
php artisan package:discover --ansi 2>/dev/null || true
|
||||||
|
|
||||||
# Public storage symlink (idempotent).
|
# Public storage symlink (idempotent).
|
||||||
if [ ! -L public/storage ] && [ -d storage/app/public ]; then
|
if [ ! -L public/storage ] && [ -d storage/app/public ]; then
|
||||||
php artisan storage:link 2>/dev/null || true
|
php artisan storage:link 2>/dev/null || true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue