Skip to content

Commit

Permalink
fix: fix Dockerfile (#6966)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Oct 29, 2023
1 parent cd1b699 commit 452f59f
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions scripts/docker/Dockerfile
Expand Up @@ -83,14 +83,14 @@ RUN set -ex; \
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

Expand All @@ -106,6 +106,9 @@ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
PHP_OPCACHE_MAX_ACCELERATED_FILES="20000" \
PHP_OPCACHE_MEMORY_CONSUMPTION="192" \
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10"
# Limits
ENV PHP_MEMORY_LIMIT="512M" \
PHP_UPLOAD_LIMIT="512M"
RUN set -ex; \
\
docker-php-ext-enable opcache; \
Expand All @@ -123,7 +126,11 @@ RUN set -ex; \
\
echo 'apc.enable_cli=1' >> $PHP_INI_DIR/conf.d/docker-php-ext-apcu.ini; \
\
echo 'memory_limit=512M' > $PHP_INI_DIR/conf.d/memory-limit.ini
{ \
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}'; \
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/limits.ini;

RUN set -ex; \
\
Expand All @@ -136,6 +143,15 @@ RUN set -ex; \
} > $APACHE_CONFDIR/conf-available/remoteip.conf; \
a2enconf remoteip

# set apache config LimitRequestBody
ENV APACHE_BODY_LIMIT 1073741824
RUN set -ex; \
\
{ \
echo 'LimitRequestBody ${APACHE_BODY_LIMIT}'; \
} > $APACHE_CONFDIR/conf-available/apache-limits.conf; \
a2enconf apache-limits

RUN set -ex; \
APACHE_DOCUMENT_ROOT=/var/www/html/public; \
sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" $APACHE_CONFDIR/sites-available/*.conf; \
Expand Down

0 comments on commit 452f59f

Please sign in to comment.