FROM php:8.3.4-fpm-bullseye # Set working directory WORKDIR /var/www/html # Install system dependencies RUN apt-get update && apt-get install -y \ git \ curl \ libpng-dev \ libonig-dev \ libxml2-dev \ zip \ unzip \ libzip-dev \ libfreetype6-dev \ libjpeg62-turbo-dev \ libwebp-dev \ libicu-dev \ supervisor \ nginx \ gnupg2 \ apt-transport-https \ ca-certificates \ lsb-release \ software-properties-common \ unixodbc-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Add Microsoft repository and install ODBC driver 17 RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && apt-get update \ && ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools \ && echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Configure OpenSSL to allow TLS 1.0 and 1.1 for SQL Server 2008 compatibility RUN echo "openssl_conf = openssl_init" > /etc/ssl/openssl.cnf.new \ && echo "" >> /etc/ssl/openssl.cnf.new \ && echo "[openssl_init]" >> /etc/ssl/openssl.cnf.new \ && echo "ssl_conf = ssl_sect" >> /etc/ssl/openssl.cnf.new \ && echo "" >> /etc/ssl/openssl.cnf.new \ && echo "[ssl_sect]" >> /etc/ssl/openssl.cnf.new \ && echo "system_default = system_default_sect" >> /etc/ssl/openssl.cnf.new \ && echo "" >> /etc/ssl/openssl.cnf.new \ && echo "[system_default_sect]" >> /etc/ssl/openssl.cnf.new \ && echo "MinProtocol = TLSv1.0" >> /etc/ssl/openssl.cnf.new \ && echo "MaxProtocol = TLSv1.2" >> /etc/ssl/openssl.cnf.new \ && echo "CipherString = DEFAULT@SECLEVEL=1" >> /etc/ssl/openssl.cnf.new \ && echo "" >> /etc/ssl/openssl.cnf.new \ && cat /etc/ssl/openssl.cnf >> /etc/ssl/openssl.cnf.new \ && mv /etc/ssl/openssl.cnf.new /etc/ssl/openssl.cnf # Set environment variable to use the custom OpenSSL configuration ENV OPENSSL_CONF=/etc/ssl/openssl.cnf # Configure and install PHP extensions RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp RUN docker-php-ext-install -j$(nproc) \ bcmath \ ctype \ fileinfo \ gd \ intl \ mbstring \ pdo \ pdo_mysql \ xml \ zip \ opcache \ pcntl \ sockets # Install PECL extensions RUN pecl install redis && docker-php-ext-enable redis # Install SQL Server extensions RUN pecl install sqlsrv && docker-php-ext-enable sqlsrv RUN pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv # Clean up PECL cache RUN rm -rf /tmp/pear # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Install Node.js and npm (using NodeSource repository for latest version) RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs # Configure PHP-FPM RUN sed -i 's/listen = 127.0.0.1:9000/listen = 127.0.0.1:9000/' /usr/local/etc/php-fpm.d/www.conf # Configure PHP settings RUN echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/uploads.ini \ && echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/uploads.ini \ && echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/uploads.ini \ && echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/uploads.ini \ && echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/opcache.ini \ && echo "opcache.memory_consumption=128" >> /usr/local/etc/php/conf.d/opcache.ini \ && echo "opcache.interned_strings_buffer=8" >> /usr/local/etc/php/conf.d/opcache.ini \ && echo "opcache.max_accelerated_files=4000" >> /usr/local/etc/php/conf.d/opcache.ini \ && echo "opcache.revalidate_freq=2" >> /usr/local/etc/php/conf.d/opcache.ini \ && echo "opcache.fast_shutdown=1" >> /usr/local/etc/php/conf.d/opcache.ini # Remove default nginx configuration and configure Nginx RUN rm -f /etc/nginx/sites-enabled/default COPY <