From b404242905263325c8b4c3446f812943a87d87c1 Mon Sep 17 00:00:00 2001 From: Peter Havekes Date: Thu, 19 Dec 2024 15:52:20 +0100 Subject: [PATCH] Use php8 for docker builds --- docker/Dockerfile.prod | 19 +++++++------------ docker/Dockerfile.test | 16 +++++++--------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index aab4ab55c..be42fa234 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -1,29 +1,24 @@ -FROM ghcr.io/openconext/openconext-basecontainers/php72-apache2:latest +FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest AS php-build ARG APP_VERSION ARG GIT_SHA ARG GIT_COMMIT_TIME ENV OPENCONEXT_APP_VERSION=${APP_VERSION} ENV OPENCONEXT_GIT_SHA=${GIT_SHA} ENV OPENCONEXT_COMMIT_DATE=${GIT_COMMIT_TIME} - COPY *.tar.bz2 /tmp/ RUN tar -xvjf /tmp/*.tar.bz2 -C /var/www/html/ && \ rm -rf /tmp/*.tar.bz2 -WORKDIR /var/www/html # Add the application configuration files -COPY config/legacy/parameters.yaml.dist config/legacy/parameters.yaml -COPY config/packages/prod/monolog.yaml.docker config/packages/prod/monolog.yaml +RUN cp config/openconext/parameters.yaml.dist config/openconext/parameters.yaml # Add the config files for Apache2 RUN rm -rf /etc/apache2/sites-enabled/* COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf - -# Recreate the cache directory and set the correct permissions -RUN rm -rf /var/www/html/var/cache/prod && \ - mkdir -p /var/www/html/var/cache/prod && \ - chown -R www-data /var/www/html/var - +RUN rm -rf /var/www/html/var/cache/prod && chown -R www-data /var/www/html/var EXPOSE 80 -CMD ["apache2-foreground"] +# Set the default workdir +WORKDIR /var/www/html + +CMD ["apache2-foreground"] \ No newline at end of file diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 2820fecd8..6fcc12639 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -8,14 +8,12 @@ FROM ghcr.io/openconext/openconext-basecontainers/php82-apache2:latest WORKDIR /var/www/html COPY --from=unpack /unpack/ /var/www/html/ # Add the application configuration files -COPY config/openconext/parameters.yaml.dist config/openconext/parameters.yaml - -# Add the config files for Apache2 -RUN rm -rf /etc/apache2/sites-enabled/* -COPY ./docker/conf/middleware-test-apache2.conf /etc/apache2/sites-enabled/middleware.conf -RUN rm -rf /var/www/html/var/cache/prod &&\ - mkdir -p /var/www/html/var/cache &&\ +RUN cp config/openconext/parameters.yaml.dist config/openconext/parameters.yaml && \ + rm -rf /etc/apache2/sites-enabled/* +COPY ./docker/conf/middleware-apache2.conf /etc/apache2/sites-enabled/middleware.conf +RUN rm -rf /var/www/html/var/cache/prod && \ + mkdir -p /var/www/html/var/ && \ chown -R www-data /var/www/html/var - EXPOSE 80 -CMD ["apache2-foreground"] + +CMD ["apache2-foreground"] \ No newline at end of file