# Stage 1: Build FROM joseluisq/php-fpm:8.4 AS build RUN apk add --no-cache nodejs npm WORKDIR /var/www/html COPY --chown=www-data:www-data . . RUN chmod -R 775 /var/www/html/storage \ && chmod -R 775 /var/www/html/bootstrap/cache RUN composer install --no-dev --prefer-dist \ && npm install \ && npm run build RUN chown -R www-data:www-data /var/www/html/vendor \ && chmod -R 775 /var/www/html/vendor # Stage 2: Deploy FROM joseluisq/php-fpm:8.4 COPY --from=build /var/www/html /var/www/html WORKDIR /var/www/html VOLUME ["/var/www/html/storage/app"] EXPOSE 9000 CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=9000", "--tries=1"]