- Replace Laravel Sail docker-compose with a single-container Dockerfile - Configure nginx and PHP-FPM via supervisor for production-like environment - Include optimized PHP extensions and Redis support - Simplify deployment by removing multi-service orchestration
25 lines
706 B
Docker
25 lines
706 B
Docker
FROM php:8.4-fpm
|
|
|
|
WORKDIR /var/www
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
git curl zip unzip libpng-dev libonig-dev \
|
|
libxml2-dev nginx supervisor \
|
|
&& docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd
|
|
|
|
RUN pecl install redis && docker-php-ext-enable redis
|
|
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
COPY . .
|
|
|
|
RUN composer install --no-dev --optimize-autoloader
|
|
|
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
|
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
|
|
RUN chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
|
|
|
EXPOSE 80
|
|
CMD ["/usr/bin/supervisord"] |