FROM php:8.4-apache # System packages + PHP extensions Laravel needs RUN apt-get update \ && apt-get install -y --no-install-recommends git unzip curl ca-certificates libzip-dev libicu-dev \ && docker-php-ext-install pdo_mysql zip intl opcache \ && a2enmod rewrite \ && rm -rf /var/lib/apt/lists/* # Tailwind CSS standalone CLI (no Node.js required) ARG TARGETARCH=amd64 RUN case "$TARGETARCH" in \ arm64) TW_ARCH=arm64 ;; \ *) TW_ARCH=x64 ;; \ esac \ && curl -fsSL -o /usr/local/bin/tailwindcss \ "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${TW_ARCH}" \ && chmod +x /usr/local/bin/tailwindcss # Composer (used by the entrypoint to install dependencies on first boot) COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer ENV COMPOSER_ALLOW_SUPERUSER=1 # PHP performance settings (opcache / realpath cache) COPY php-perf.ini /usr/local/etc/php/conf.d/zz-perf.ini # Serve Laravel's public/ directory ENV APACHE_DOCUMENT_ROOT=/var/www/html/public RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \ /etc/apache2/sites-available/*.conf /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # Swagger UI static assets (copied into public/vendor/swagger-ui by the entrypoint) RUN mkdir -p /opt/swagger-ui \ && curl -fsSL -o /opt/swagger-ui/swagger-ui.css "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css" \ && curl -fsSL -o /opt/swagger-ui/swagger-ui-bundle.js "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" \ && curl -fsSL -o /opt/swagger-ui/swagger-ui-standalone-preset.js "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-standalone-preset.js" COPY entrypoint.sh /usr/local/bin/entrypoint.sh # Strip Windows line endings in case the file was checked out with CRLF RUN sed -i 's/\r$//' /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/entrypoint.sh WORKDIR /var/www/html ENTRYPOINT ["entrypoint.sh"] CMD ["apache2-foreground"]