fix docker
All checks were successful
Build, Push and Deploy / build-and-deploy (push) Successful in 2m44s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s

This commit is contained in:
eko
2026-03-23 11:36:51 +07:00
parent bb599d7e0e
commit 7498a8c1e8

View File

@@ -28,23 +28,27 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Copy ALL application files first (needed for custom autoload paths)
# Copy application files
COPY --chown=www-data:www-data . .
# Create storage directories
# Remove any nested vendor directories to avoid conflicts
RUN find . -type d -name "vendor" -not -path "./vendor*" -exec rm -rf {} + 2>/dev/null || true
# Create all necessary directories
RUN mkdir -p storage/framework/{cache,sessions,views} \
&& mkdir -p storage/logs \
&& mkdir -p bootstrap/cache \
&& chmod -R 777 storage \
&& chmod -R 777 bootstrap/cache
# Install dependencies (now all app files exist for autoloading)
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
# Install dependencies
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader --no-scripts \
&& composer run-script post-autoload-dump \
&& php artisan package:discover --ansi || true
# Generate key (after composer install)
RUN php artisan key:generate --no-interaction --force
# Generate application key
RUN php artisan key:generate --no-interaction --force || true
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh