optimize dockerfile and copy js library used

This commit is contained in:
2025-07-14 16:10:52 +07:00
parent 5b14523f84
commit 4b9be55d32
17 changed files with 2439 additions and 174 deletions

View File

@@ -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} \