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 \
vim \
nano \
htop \
@@ -51,17 +49,13 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy dependency files first for better caching
COPY composer.json composer.lock ./
COPY package.json package-lock.json ./
# Now copy the entire application code (after npm/composer install)
# Now copy the entire application code (after composer install)
COPY . .
# Install PHP dependencies (with dev)
RUN composer install --no-interaction
# Install Node dependencies (cached if package-lock.json not changed)
RUN npm install
# Set ownership and permissions
RUN mkdir -p storage/logs \
&& mkdir -p storage/framework/{cache,sessions,views} \
@@ -76,7 +70,7 @@ COPY ./docker/nginx.dev.conf /etc/nginx/sites-available/default
COPY ./docker/supervisord.dev.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./docker/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Expose web port + possible Webpack/Vite
EXPOSE 80 3000
# Expose web port
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]