diff --git a/PHP8.2/PROD/Dockerfile b/PHP8.2/PROD/Dockerfile index 93d17c9..5acc8f2 100644 --- a/PHP8.2/PROD/Dockerfile +++ b/PHP8.2/PROD/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.2-apache +FROM php:8.2-apache-bullseye RUN apt-get update -qq && \ apt-get install -qy \ @@ -27,7 +27,9 @@ RUN apt-get update -qq && \ # ldap ldap-utils libldap2-dev \ # locales - locales + locales \ + # libcap + libcap2-bin # LOCALES ENV DEBIAN_FRONTEND noninteractive @@ -53,7 +55,7 @@ RUN docker-php-ext-configure ldap RUN docker-php-ext-install exif gd gettext intl mysqli pdo_mysql xsl opcache zip bcmath ldap RUN pecl install imagick-3.6.0 && docker-php-ext-enable imagick -RUN pecl install memcached-3.1.5 && docker-php-ext-enable memcached +RUN pecl install memcached-3.2.0 && docker-php-ext-enable memcached RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -69,5 +71,11 @@ RUN a2enmod rewrite remoteip headers http2 && \ a2enconf z-app RUN mkdir -p /app/tmp && chmod -R 770 /app/tmp && chown -R www-data:www-data /app + +#Change access righs to conf, logs, bin from root to www-data +RUN chown -hR www-data:www-data /var/log/apache2 +#setcap to bind to privileged ports as non-root +RUN setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2 + USER www-data WORKDIR /app/srcs \ No newline at end of file diff --git a/PHP8.2/PROD/conf/common-ports.conf b/PHP8.2/PROD/conf/common-ports.conf index 898f77b..6f0083f 100644 --- a/PHP8.2/PROD/conf/common-ports.conf +++ b/PHP8.2/PROD/conf/common-ports.conf @@ -2,6 +2,6 @@ # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf -Listen 4433 +Listen 443 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet \ No newline at end of file diff --git a/PHP8.2/PROD/conf/vhost.conf b/PHP8.2/PROD/conf/vhost.conf index 46e9c9b..211d703 100644 --- a/PHP8.2/PROD/conf/vhost.conf +++ b/PHP8.2/PROD/conf/vhost.conf @@ -1,4 +1,4 @@ - + Protocols h2 h2c http/1.1 ServerAdmin contact@ldc.fr DocumentRoot /app/srcs/public