fix docker
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -28,23 +28,20 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# Copy ONLY composer files first (for better caching)
|
||||
COPY composer.json composer.lock* ./
|
||||
|
||||
# Install dependencies (including laravel/prompts)
|
||||
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
|
||||
|
||||
# Copy the rest of the application files
|
||||
# Copy ALL application files first (needed for custom autoload paths)
|
||||
COPY --chown=www-data:www-data . .
|
||||
|
||||
# Create storage directories after copying files
|
||||
# Create storage 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
|
||||
|
||||
# Generate key (after composer install and storage setup)
|
||||
# Install dependencies (now all app files exist for autoloading)
|
||||
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
|
||||
|
||||
# Generate key (after composer install)
|
||||
RUN php artisan key:generate --no-interaction --force
|
||||
|
||||
# Copy entrypoint script
|
||||
|
||||
Reference in New Issue
Block a user