加入dockerfile

This commit is contained in:
陈俊宏 2024-07-01 18:14:29 +08:00
parent 691a88e5f6
commit 8f6ebfe886
1 changed files with 40 additions and 0 deletions

40
Dockerfile Normal file
View File

@ -0,0 +1,40 @@
FROM php:7.4-fpm-alpine
RUN curl -sfL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
&& chmod +x /usr/bin/composer \
&& composer self-update --clean-backups 2.0.8 \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update \
&& apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk add --no-cache libstdc++ protobuf make autoconf wget gcc libc-dev automake libtool openssh openrc git supervisor\
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev \
&& wget https://lsxd-dockerfile.oss-cn-chengdu.aliyuncs.com/grpc_php_plugin -P /usr/bin/ \
&& chmod +x /usr/bin/grpc_php_plugin \
&& docker-php-ext-install sockets mysqli pdo_mysql \
&& echo -e "yes\nyes\nyes\nyes\nyes\nyes\n" | pecl install swoole-4.8.0 \
&& docker-php-ext-enable swoole \
&& echo -e "yes\n" | pecl install xlswriter \
&& docker-php-ext-enable xlswriter \
&& apk add libzip libzip-dev \
&& docker-php-ext-configure zip --with-zip \
&& docker-php-ext-install -j$(nproc) zip \
&& apk add libwebp-dev libjpeg libjpeg-turbo-dev libpng libpng-dev freetype freetype-dev \
&& docker-php-ext-configure gd --with-webp=/usr/include/webp --with-jpeg=/usr/include --with-freetype=/usr/include/freetype2/ \
&& docker-php-ext-install -j$(nproc) gd \
&& pecl install redis-5.3.4 \
&& docker-php-ext-enable redis \
&& apk del .build-deps
RUN docker-php-ext-install bcmath
ADD ./startup.sh /opt/startup.sh
RUN sed -i 's/\r//g' /opt/startup.sh
RUN mkdir "/var/log/supervisor"
ADD ./supervisord.conf /etc/supervisord.conf
EXPOSE 9000 80 22
WORKDIR /var/project
CMD ["sh", "/opt/startup.sh"]