Skip to content

Commit 99f204b

Browse files
committed
feat: update Dockerfile
1 parent 0b8e060 commit 99f204b

File tree

2 files changed

+38
-66
lines changed

2 files changed

+38
-66
lines changed

Dockerfile

+38-45
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,46 @@ LABEL maintainer="dl@varme.pw"
44

55
ENV TZ=Europe/Moscow
66

7+
ARG COMPOSER_VERSION="2.5.8"
8+
ARG UID=1000
9+
ARG GID=1000
10+
711
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
812

9-
ARG COMPOSER_VERSION="2.5.4"
10-
11-
RUN set -ex && \
12-
apt-get update && apt-get install -y \
13-
libfreetype6-dev \
14-
libjpeg62-turbo-dev \
15-
libpng-dev \
16-
libgmp-dev \
17-
libwebp-dev \
18-
libxml2-dev \
19-
zlib1g-dev \
20-
libncurses5-dev \
21-
libldb-dev \
22-
libldap2-dev \
23-
libicu-dev \
24-
libmemcached-dev \
25-
libcurl4-openssl-dev \
26-
libssl-dev \
27-
libsqlite3-dev \
28-
libzip-dev \
29-
libonig-dev \
30-
curl \
31-
ssmtp \
32-
wget \
33-
git \
34-
nano \
35-
zip \
36-
mariadb-client \
37-
&& rm -rf /var/lib/apt/lists/*
38-
39-
RUN pecl install xdebug-3.1.1 \
40-
&& pecl install memcached-3.1.5 \
41-
&& pecl install redis \
42-
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
43-
&& docker-php-ext-configure mysqli --with-mysqli=mysqlnd \
44-
&& docker-php-ext-configure opcache --enable-opcache \
45-
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
46-
&& docker-php-ext-install -j$(nproc) mysqli pdo_mysql bcmath pcntl intl gmp mbstring gd soap zip opcache sockets
47-
48-
RUN wget https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -O /usr/local/bin/composer && \
49-
chmod a+rx /usr/local/bin/composer
50-
51-
RUN groupadd --gid 1000 1000 && \
52-
usermod --non-unique --uid 1000 www-data && \
53-
usermod --gid 1000 www-data
13+
RUN set -ex && apt-get update && apt-get install -y ssmtp wget git nano
14+
15+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
16+
17+
RUN IPE_GD_WITHOUTAVIF=1 IPE_ICU_EN_ONLY=1 IPE_KEEP_SYSPKG_CACHE=1 install-php-extensions \
18+
bcmath \
19+
exif \
20+
gd \
21+
gmp \
22+
imagick \
23+
intl \
24+
ldap \
25+
mysqli \
26+
opcache \
27+
pcntl \
28+
pdo_mysql \
29+
pdo_pgsql \
30+
pgsql \
31+
soap \
32+
sockets \
33+
xdebug \
34+
zip
35+
36+
RUN IPE_ICU_EN_ONLY=1 IPE_DONT_ENABLE=1 install-php-extensions \
37+
memcache \
38+
memcached \
39+
redis \
40+
xhprof
41+
42+
RUN install-php-extensions @composer-${COMPOSER_VERSION}
43+
44+
RUN groupadd --gid ${GID} ${GID} && \
45+
usermod --non-unique --uid ${UID} www-data && \
46+
usermod --gid ${GID} www-data
5447

5548
RUN mkdir /var/www/.composer && \
5649
mkdir /var/www/.ssh

docker-entrypoint.sh

-21
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ if [ "$PHP_MODULES" != "" ]; then
77
done
88
fi
99

10-
# Set memcached session save handle
11-
if [ -n "$MEMCACHED" ]; then
12-
if [ -f "$PHP_INI_DIR"/conf.d/20-memcached.ini ]; then
13-
rm "$PHP_INI_DIR"/conf.d/20-memcached.ini
14-
fi
15-
16-
if [ ! -f "$PHP_INI_DIR"/conf.d/docker-php-ext-memcached.ini ]; then docker-php-ext-enable memcached >/dev/null; fi
17-
18-
IFSO=$IFS
19-
IFS=' ' read -ra BACKENDS <<<"${MEMCACHED}"
20-
for BACKEND in "${BACKENDS[@]}"; do
21-
SAVE_PATH="${SAVE_PATH}${BACKEND}?${MEMCACHED_CONFIG:-persistent=1&timeout=5&retry_interval=30},"
22-
done
23-
IFS=$IFSO
24-
25-
cat <<EOF >>"$PHP_INI_DIR"/conf.d/20-memcached.ini
26-
session.save_handler = memcached
27-
session.save_path = "${SAVE_PATH}"
28-
EOF
29-
fi
30-
3110
# Run
3211
if [[ -n "$1" ]]; then
3312
exec "${*}"

0 commit comments

Comments
 (0)