fix composer install

This commit is contained in:
2025-09-19 22:12:28 +07:00
parent ed920e8e7b
commit 3092ecf34b

View File

@@ -46,20 +46,19 @@ RUN pecl install redis \
# Install Composer # Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy only composer and package files first for caching # Copy only composer files first for caching
COPY composer.json composer.lock package.json package-lock.json ./ COPY composer.json composer.lock ./
# Install PHP dependencies (cached if lock file unchanged) # Install PHP dependencies (cached if lock file unchanged)
RUN composer install --optimize-autoloader --no-dev --no-interaction RUN composer install --optimize-autoloader --no-dev --no-interaction --no-scripts
# Install Node dependencies (cached if lock file unchanged)
RUN npm ci --only=production
# Now copy the full Laravel application code # Now copy the full Laravel application code
COPY . . COPY . .
# Build assets and create storage link # Run composer scripts and install Node dependencies
RUN npm run production && \ RUN composer run-script post-autoload-dump && \
npm install && \
npm run production && \
php artisan storage:link php artisan storage:link
# Set proper permissions (for production only do this once) # Set proper permissions (for production only do this once)