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