optimize dockerfile and copy js library used
This commit is contained in:
@@ -21,8 +21,6 @@ RUN apt-get update && apt-get install -y \
|
||||
libvpx-dev \
|
||||
supervisor \
|
||||
nginx \
|
||||
nodejs \
|
||||
npm \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PHP extensions
|
||||
@@ -49,18 +47,12 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
# Copy only composer files first for caching
|
||||
COPY composer.json composer.lock ./
|
||||
|
||||
# Copy only npm files first for caching
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Now copy the full Laravel application code
|
||||
COPY . .
|
||||
|
||||
# Install PHP dependencies (cached if lock file unchanged)
|
||||
RUN composer install --optimize-autoloader --no-dev --no-interaction
|
||||
|
||||
# Install Node.js dependencies and build assets
|
||||
RUN npm ci && npm run production && rm -rf node_modules
|
||||
|
||||
# Set proper permissions (for production only do this once)
|
||||
RUN mkdir -p storage/logs \
|
||||
&& mkdir -p storage/framework/{cache,sessions,views} \
|
||||
|
||||
Reference in New Issue
Block a user