FROM php:8.4-fpm # Install system dependencies RUN apt-get update && apt-get install -y \ git \ curl \ libpng-dev \ libonig-dev \ libxml2-dev \ libzip-dev \ zip \ unzip \ nginx \ supervisor \ && rm -rf /var/lib/apt/lists/* # Install PHP extensions RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd sockets zip # Install Redis extension RUN pecl install redis && docker-php-ext-enable redis # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Set working directory WORKDIR /var/www/html # Copy application files COPY atomcms/ . # Note: Skipping composer install due to package bug # Using pre-installed vendor directory from host # Set permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html/storage \ && chmod -R 755 /var/www/html/bootstrap/cache # Copy nginx configuration COPY cms/docker/nginx-site.conf /etc/nginx/sites-available/default # Copy supervisor configuration COPY cms/docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Create nginx log directory RUN mkdir -p /var/log/nginx && \ chown -R www-data:www-data /var/log/nginx # Expose ports EXPOSE 80 443 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD curl -f http://localhost/ || exit 1 # Start supervisor CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]