FROM php:8.3-fpm-bookworm

# Add the installer for PHP extensions
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

# Install dependencies for building OpenSSL
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    checkinstall \
    zlib1g-dev \
    vim

# Install PHP extensions
RUN install-php-extensions mysqli pdo_mysql sqlsrv pdo_sqlsrv redis

# Clean up unnecessary files
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY openssl.cnf /etc/ssl/openssl.cnf

