Performance: Docker deployment
MEDIUM IMPACT
Docker deployment affects the initial page load speed and server response time by controlling how the Laravel app and its dependencies are packaged and started.
FROM php:8.1-fpm-alpine RUN apk add --no-cache git unzip WORKDIR /app COPY composer.json composer.lock ./ RUN composer install --no-dev --optimize-autoloader COPY . . EXPOSE 9000 CMD ["php-fpm"]
FROM php:8.1-apache RUN apt-get update && apt-get install -y git unzip COPY . /var/www/html RUN composer install EXPOSE 80 CMD ["apache2-foreground"]
| Pattern | Image Size | Startup Time | Resource Usage | Verdict |
|---|---|---|---|---|
| Heavy base image with full PHP and Apache | Large (700MB+) | Slow (20+ seconds) | High CPU and Memory | [X] Bad |
| Lightweight Alpine PHP-FPM with cached dependencies | Small (200-400MB) | Fast (under 5 seconds) | Low CPU and Memory | [OK] Good |