diff --git a/.gitattributes b/.gitattributes index 042a8fae8..ecff6abb4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ # Treat SVGs like images, and not like text. *.svg binary Dockerfile text eol=lf +Podmanfile text eol=lf *.sh eol=lf diff --git a/Dockerfile b/Dockerfile index 26194db8a..c76c6e25b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ # syntax=docker/dockerfile:1 +# Please keep the content of this file in sync with Podmanfile. ARG BUILDER_CONFIGURATION="release" FROM php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d AS composer-builder diff --git a/Podmanfile b/Podmanfile new file mode 100644 index 000000000..3ce30ad8e --- /dev/null +++ b/Podmanfile @@ -0,0 +1,40 @@ +# syntax=docker/dockerfile:1 +# Please keep the content of this file in sync with Dockerfile. +# Take care to have here the full path to the images. Podman cannot handle Docker's short form. + +ARG BUILDER_CONFIGURATION="release" +FROM docker.io/library/php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d AS composer-builder + +# Install Zip to use composer +RUN apt-get update && apt-get install -y \ + zlib1g-dev \ + libzip-dev \ + unzip +RUN docker-php-ext-install zip + +# Install and update composer +COPY --from=docker.io/library/composer /usr/bin/composer /usr/bin/composer +RUN composer self-update + +# Do not switch the user! Podman needs root to install composer. +WORKDIR /composer +COPY composer.* /composer/ +# Consume the build argment +ARG BUILDER_CONFIGURATION +RUN if [ "$BUILDER_CONFIGURATION" = "debug" ]; then \ + # composer install --dev deprecated + COMPOSER_NO_DEV=0 composer install ; \ + else \ + COMPOSER_NO_DEV=1 composer install ; \ + fi + +# Site +FROM docker.io/library/php:7.4-apache@sha256:c9d7e608f73832673479770d66aacc8100011ec751d1905ff63fae3fe2e0ca6d +COPY resources/keyman-site.conf /etc/apache2/conf-available/ +RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini +RUN chown -R www-data:www-data /var/www/html/ + +COPY --from=composer-builder /composer/vendor /var/www/vendor +RUN a2enmod rewrite headers; a2enconf keyman-site + +# RUN echo LogLevel alert rewrite:trace6 >> /etc/apache2/apache2.conf