FROM php:8.4-fpm-alpine # Install system dependencies RUN apk add --no-cache \ nginx \ supervisor \ curl \ zip \ unzip \ git \ oniguruma-dev \ libpng-dev \ libjpeg-turbo-dev \ freetype-dev \ libzip-dev \ mysql-client \ icu-dev # Install PHP extensions RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd zip intl # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Set working directory WORKDIR /var/www/html # Copy config files COPY docker/etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf COPY docker/etc/supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY docker/start.sh ./start.sh COPY .env.example ./.env # Copy application files COPY . . # Install dependencies RUN composer install --no-dev --optimize-autoloader # Set permissions RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache \ && chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache EXPOSE 80 CMD ["./start.sh"]