diff --git a/Dockerfile b/Dockerfile index 684a16027..e4ea1c8e7 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,13 @@ FROM php:8-apache +# use docker-php-extension-installer for automatically get the right packages installed +ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + + # Install extensions -RUN apt-get update && apt-get install -y --no-install-recommends \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libpq-dev \ - && docker-php-ext-install -j$(nproc) iconv \ - && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ - && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ - && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \ - && rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \ - && apt-get remove -y libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libpq-dev \ +RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql + +RUN rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \ && apt autoremove -y \ && rm -rf /var/lib/apt/lists/* @@ -42,11 +35,11 @@ ENV PASSWORD=password ENV TELEMETRY=false ENV ENABLE_ID_OBFUSCATION=false ENV REDACT_IP_ADDRESSES=false -ENV WEBPORT=80 +ENV WEBPORT=8080 # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH # Final touches -EXPOSE 80 +EXPOSE ${WEBPORT} CMD ["bash", "/entrypoint.sh"] diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 633ceec19..bc0f7464d 100755 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,26 +1,26 @@ FROM php:8-alpine - -# Install extensions RUN apk add --quiet --no-cache \ bash \ apache2 \ - apache2-ssl \ - php83-apache2 \ - php83-ctype \ - php83-openssl \ - freetype-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libpq-dev \ - && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ - && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ - && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \ - && rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \ - && apk del --quiet --no-cache \ - freetype-dev \ - libjpeg-turbo-dev \ - libpng-dev \ - libpq-dev + php-apache2 \ + php-ctype \ + php-gd \ + php-openssl \ + php-pdo \ + php-pdo_mysql \ + php-pdo_pgsql \ + php-pdo_sqlite \ + php-pgsql \ + php-session \ + php-sqlite3 + +# use docker-php-extension-installer for automatically get the right packages installed +ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + + + +# Install extensions +RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql RUN ln -sf /dev/stdout /var/log/apache2/access.log && \ ln -sf /dev/stderr /var/log/apache2/error.log @@ -49,11 +49,11 @@ ENV PASSWORD=password ENV TELEMETRY=false ENV ENABLE_ID_OBFUSCATION=false ENV REDACT_IP_ADDRESSES=false -ENV WEBPORT=80 +ENV WEBPORT=8080 # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH # Final touches -EXPOSE 80 +EXPOSE ${WEBPORT} CMD ["bash", "/entrypoint.sh"]