Skip to content

Commit

Permalink
udpating openssl and cert
Browse files Browse the repository at this point in the history
  • Loading branch information
tuehoang committed Nov 18, 2024
1 parent 0571edf commit b532224
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
FROM php:8.3-fpm

RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
# Install necessary dependencies and PHP extensions
RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
libpng-dev \
libxml2-dev \
libldap2-dev \
libldb-dev \
libzip-dev \
unzip \
git \
openssl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \
&& ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \
&& docker-php-ext-install -j$(nproc) xml gd ldap mysqli pdo_mysql zip \
&& pecl install timezonedb xdebug\
&& docker-php-ext-enable timezonedb xdebug
&& pecl install timezonedb xdebug \
&& docker-php-ext-enable timezonedb xdebug \
&& update-ca-certificates # Ensure OpenSSL CA certificates are updated

# Copy Composer from the Composer official image
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer

# Copy PHP configuration
COPY docker/php.ini /usr/local/etc/php/

# Copy the application code
COPY . /var/www/html

# Copy custom entrypoint script for PHP-FPM
COPY docker/docker-entrypoint-php-fpm.sh /

# Install PHP dependencies using Composer and set correct permissions
RUN cd /var/www/html \
&& composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --optimize-autoloader \
&& mkdir -p /var/www/html/app/tmp/cache/persistent /var/www/html/app/tmp/cache/models /var/www/html/app/tmp/logs \
&& chown www-data:www-data -R /var/www/html/app/tmp/cache \
&& chown www-data:www-data -R /var/www/html/app/tmp/logs

# Customize PHP-FPM configuration
RUN set -ex \
## Customize PHP fpm configuration
&& sed -i -e "s/;clear_env\s*=\s*no/clear_env = no/g" /usr/local/etc/php-fpm.conf \
&& sed -i -e "s/;request_terminate_timeout\s*=[^\n]*/request_terminate_timeout = 300/g" /usr/local/etc/php-fpm.conf \
&& php-fpm --test

# Set the entrypoint for PHP-FPM
CMD ["/docker-entrypoint-php-fpm.sh"]

0 comments on commit b532224

Please sign in to comment.