Skip to content

Commit

Permalink
optimalisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Wojczal committed Jan 18, 2024
1 parent 03e53f3 commit 064cf19
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,99 @@ RUN set -eux \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)

# -------------------- Installing PHP Extension: gd --------------------
RUN set -eux \
# Generic pre-command
&& ln -s /usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)/libXpm.* /usr/lib/ \
# Installation: Version specific
# Type: Built-in extension
# Custom: configure command
&& docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif \
# Installation
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) gd \
&& true

# -------------------- Installing PHP Extension: opcache --------------------
RUN set -eux \
# Version specific pre-command
&& curl -sS https://raw.githubusercontent.com/php/php-src/php-8.0.6/ext/opcache/Optimizer/zend_dfg.h > /usr/local/include/php/Zend/Optimizer/zend_dfg.h \
# Installation: Version specific
# Type: Built-in extension
# Installation
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) opcache \
&& true

# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Generic pre-command
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
\
# Installation: Generic
# Type: GIT extension
&& git clone https://github.com/phpredis/phpredis /tmp/redis \
&& cd /tmp/redis \
# Custom: Branch
&& git checkout $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1) \
# Custom: Install command
&& REDIS_ARGS=""; \
if php -m | grep -q "igbinary"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if php -m | grep -q "lz4"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
fi; \
if php -m | grep -q "lzf"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lzf --with-liblzf=/usr"; \
fi; \
if php -m | grep -q "msgpack"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
if php -m | grep -q "zstd"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
\
# Enabling
&& docker-php-ext-enable redis \
&& true

# -------------------- Installing PHP Extension: pdo_pgsql --------------------
RUN set -eux \
# Installation: Generic
# Type: Built-in extension
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_pgsql \
&& true

# -------------------- Installing PHP Extension: pgsql --------------------
RUN set -eux \
# Installation: Generic
# Type: Built-in extension
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \
&& true

# -------------------- Installing PHP Extension: sodium --------------------
RUN set -eux \
# Installation: Generic
# Type: Built-in extension
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) sodium \
&& true


# -------------------- Installing PHP Extension: zip --------------------
RUN set -eux \
# Installation: Generic
# Type: Built-in extension
# Custom: configure command
&& docker-php-ext-configure zip --with-zip \
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) zip \
&& true


# composer
RUN curl --silent --show-error https://getcomposer.org/composer.phar > composer.phar \
&& mv composer.phar /usr/bin/composer
Expand Down

0 comments on commit 064cf19

Please sign in to comment.