FROM php:8.2.27-cli-alpine3.20
RUN apk update
ARG timezone
ENV TIMEZONE=${timezone:-"Europe/Amsterdam"} \
SCAN_CACHEABLE=(true)
RUN set -ex \
# show php version and extensions
&& php -v \
&& php -m \
# ---------- some config ---------- \
&& cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
&& cd /usr/local/etc/php/ \
# - config PHP
&& { \
echo "upload_max_filesize=128M"; \
echo "post_max_size=128M"; \
echo "memory_limit=1G"; \
echo "date.timezone=${TIMEZONE}"; \
} | tee conf.d/99_overrides.ini \
# - config timezone
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
# ---------- clear works ----------
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
RUN apk add --no-cache curl-dev boost-dev make --no-cache -U autoconf g++ libpng libpng-dev libjpeg-turbo libjpeg-turbo-dev freetype freetype-dev linux-headers libzip-dev netcat-openbsd bash busybox-extras libc6-compat
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install bcmath gd sockets zip
COPY swoole-src-5.1.7.zip /tmp/swoole-src-5.1.7.zip
RUN cd /tmp && unzip swoole-src-5.1.7.zip && cd /tmp/swoole-src-5.1.7 && phpize && ./configure --enable-swoole-curl && make -j$(nproc) && make install
WORKDIR /data/projects
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apk add openldap-dev yaml-dev
RUN docker-php-ext-install ldap pcntl pdo pdo_mysql
RUN pecl install redis-6.0.2 yaml
RUN echo extension=swoole.so > /usr/local/etc/php/conf.d/swoole.ini \
&& echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \
&& echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \
# RUN php --ri swoole
# 安装composer 推送仓库配置
RUN composer global config --no-plugins allow-plugins.elendev/composer-push true
RUN composer global require elendev/composer-push --no-interaction --prefer-dist --no-progress --no-suggest --no-scripts --no-plugins
依赖说明
- swoole boost-dev
- 扩展 autoconf g++
- telnet busybox-extras
- ldap openldap-dev
967

被折叠的 条评论
为什么被折叠?



