fix docker
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -28,23 +28,27 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
# Copy ALL application files first (needed for custom autoload paths)
|
# Copy application files
|
||||||
COPY --chown=www-data:www-data . .
|
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} \
|
RUN mkdir -p storage/framework/{cache,sessions,views} \
|
||||||
&& mkdir -p storage/logs \
|
&& mkdir -p storage/logs \
|
||||||
&& mkdir -p bootstrap/cache \
|
&& mkdir -p bootstrap/cache \
|
||||||
&& chmod -R 777 storage \
|
&& chmod -R 777 storage \
|
||||||
&& chmod -R 777 bootstrap/cache
|
&& chmod -R 777 bootstrap/cache
|
||||||
|
|
||||||
# Install dependencies (now all app files exist for autoloading)
|
# Install dependencies
|
||||||
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
|
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)
|
# Generate application key
|
||||||
RUN php artisan key:generate --no-interaction --force
|
RUN php artisan key:generate --no-interaction --force || true
|
||||||
|
|
||||||
# Copy entrypoint script
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user