FROM php:8.4-fpm-alpine # Install system dependencies RUN apk add --no-cache \ curl \ git \ zip \ unzip \ libzip-dev \ imagemagick \ libreoffice \ libreoffice-lang-de \ ghostscript \ poppler-utils \ sqlite \ sqlite-dev \ postgresql-client \ mysql-client \ nodejs \ npm # Install PHP extensions (only those not built-in) RUN docker-php-ext-install \ pdo_sqlite \ pdo_mysql \ zip \ bcmath # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Set working directory WORKDIR /app # Copy application files COPY . . # Install PHP dependencies RUN composer install --no-interaction --no-dev --optimize-autoloader # Install Node dependencies RUN npm install --legacy-peer-deps # Build Vite assets RUN npm run build # Create necessary directories RUN mkdir -p storage/logs storage/framework/views storage/framework/cache \ && chmod -R 775 storage bootstrap/cache # Expose port EXPOSE 8000 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:8000/up || exit 1 # Start PHP-FPM CMD ["php-fpm"]