Browse Source

add apache image for typo3 usage

ksieren 2 năm trước cách đây
mục cha
commit
7572f093c8
1 tập tin đã thay đổi với 35 bổ sung94 xóa
  1. 35 94
      Dockerfile

+ 35 - 94
Dockerfile

@@ -1,104 +1,45 @@
-ARG ARCH=
-FROM ${ARCH}alpine:3.15
+FROM php:7.4-apache-buster
 
 LABEL Maintainer="kerstin Sieren <kerstin@sieren.biz>" \
-      Description="Lightweight container with Nginx & PHP-FPM based on Alpine Linux."
-
-# Install packages
-RUN apk --no-cache add \
-        php7 \
-        php7-fpm \
-        php7-opcache \
-        php7-pecl-apcu \
-        php7-mysqli \
-        php7-pgsql \
-        php7-json \
-        php7-openssl \
-        php7-curl \
-        php7-zlib \
-        php7-soap \
-        php7-xml \
-        php7-fileinfo \
-        php7-phar \
-        php7-intl \
-        php7-dom \
-        php7-xmlrpc \
-        php7-xmlreader \
-        php7-xmlwriter \
-        php7-ctype \
-        php7-session \
-        php7-iconv \
-        php7-tokenizer \
-        php7-zip \
-        php7-simplexml \
-        php7-mbstring \
-        php7-gd \
-        php7-imagick \
-        php7-pecl-mongodb \
-        php7-pdo_mysql \
-        php7-pdo_pgsql \
-        php7-pdo_sqlite \
-        nginx \
-        runit \
-        curl \
-        tar \
-# Bring in gettext so we can get `envsubst`, then throw
-# the rest away. To do this, we need to install `gettext`
-# then move `envsubst` out of the way so `gettext` can
-# be deleted completely, then move `envsubst` back.
-    && apk add --no-cache --virtual .gettext gettext \
-    && mv /usr/bin/envsubst /tmp/ \
-    && runDeps="$( \
-        scanelf --needed --nobanner /tmp/envsubst \
-            | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
-            | sort -u \
-            | xargs -r apk info --installed \
-            | sort -u \
-    )" \
-    && apk add --no-cache $runDeps \
-    && apk del .gettext \
-    && mv /tmp/envsubst /usr/local/bin/ \
-# Remove alpine cache
-    && rm -rf /var/cache/apk/* \
-# Remove default server definition
-    && rm /etc/nginx/http.d/default.conf \
-# Make sure files/folders needed by the processes are accessable when they run under the nobody user
-    && chown -R nobody.nobody /run \
-    && chown -R nobody.nobody /var/lib/nginx \
-    && chown -R nobody.nobody /var/log/nginx \
-    && apk add --no-cache git
+      Description="Lightweight container with Apache & PHP-FPM based on Debian Buster."
+
+RUN apt-get update && \
+    apt-get upgrade -y && \
+    apt-get install -y --no-install-recommends \
+        wget git \
+# Configure PHP
+        libxml2-dev libfreetype6-dev \
+        libjpeg62-turbo-dev \
+        libmcrypt-dev \
+        libpng-dev \
+        libpq-dev \
+        libzip-dev \
+        zlib1g-dev \
+# Install required 3rd party tools
+        graphicsmagick && \
+# Configure extensions
+    docker-php-ext-configure gd --with-libdir=/usr/include/ --with-jpeg --with-freetype && \
+    docker-php-ext-install -j$(nproc) mysqli soap gd zip opcache intl pgsql pdo_pgsql && \
+    echo 'always_populate_raw_post_data = -1\nmax_execution_time = 240\nmax_input_vars = 1500\nupload_max_filesize = 32M\npost_max_size = 32M' > /usr/local/etc/php/conf.d/typo3.ini && \
+# Configure Apache as needed
+    a2enmod rewrite && \
+    apt-get clean && \
+    apt-get -y purge \
+        libxml2-dev libfreetype6-dev \
+        libjpeg62-turbo-dev \
+        libmcrypt-dev \
+        libpng-dev \
+        libzip-dev \
+        zlib1g-dev && \
+    rm -rf /var/lib/apt/lists/* /usr/src/* \
 
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
 
-# Add configuration files
-COPY --chown=nobody rootfs/ /
-
 # Switch to use a non-root user from here on
-USER nobody
+#USER nobody
 
 # Add application
 WORKDIR /var/www/html
 
-# Expose the port nginx is reachable on
-EXPOSE 8080
-
-# Let runit start nginx & php-fpm
-CMD [ "/bin/docker-entrypoint.sh" ]
-
-# Configure a healthcheck to validate that everything is up&running
-HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
-
-ENV client_max_body_size=5M \
-    clear_env=no \
-    allow_url_fopen=On \
-    allow_url_include=Off \
-    display_errors=Off \
-    file_uploads=On \
-    max_execution_time=0 \
-    max_input_time=-1 \
-    max_input_vars=1000 \
-    memory_limit=-1 \
-    post_max_size=8M \
-    upload_max_filesize=5M \
-    variables_order="EGPCS" \
-    zlib.output_compression=On
+# Expose the port apache is reachable on
+EXPOSE 80