FROM php:8.4-cli LABEL maintainer="Taylor Otwell" ARG WWWGROUP=1000 ARG NODE_VERSION=20 ARG SUPERVISOR_PHP_USER=sail WORKDIR /var/www/html ENV DEBIAN_FRONTEND=noninteractive ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone # System dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ git curl zip unzip supervisor cron nano \ ca-certificates gnupg \ libpng-dev libjpeg-dev libfreetype6-dev \ libonig-dev libxml2-dev libzip-dev \ libicu-dev \ && rm -rf /var/lib/apt/lists/* # PHP extensions RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install \ pcntl \ pdo \ intl \ zip \ opcache \ gd \ mbstring \ xml \ bcmath # Swoole extension (CRITICAL) RUN pecl install swoole redis \ && docker-php-ext-enable swoole redis # Composer RUN curl -sS https://getcomposer.org/installer \ | php -- --install-dir=/usr/bin --filename=composer # Install Node.js (includes npm) RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* # Verify installation RUN node --version && npm --version # User RUN groupadd --force -g ${WWWGROUP} ${SUPERVISOR_PHP_USER} \ && useradd -ms /bin/bash --no-user-group \ -g ${WWWGROUP} -u 1337 ${SUPERVISOR_PHP_USER} # Set proper permissions RUN mkdir -p /var/www/html/storage /var/www/html/bootstrap/cache RUN chown -R sail:sail /var/www/html/storage /var/www/html/bootstrap/cache RUN chmod -Rf 777 /var/www/html/storage /var/www/html/bootstrap/cache # Supervisor COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf RUN chmod +x /usr/local/bin/start-container # Cron COPY cronjobs /etc/cron.d/cronjobs RUN chmod 0644 /etc/cron.d/cronjobs \ && crontab /etc/cron.d/cronjobs \ && touch /var/log/cron.log EXPOSE 8000 ENTRYPOINT ["start-container"]