From 8f6ebfe88612cf59618b6baf73d7f69660afb634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BF=8A=E5=AE=8F?= <389838709@qq.com> Date: Mon, 1 Jul 2024 18:14:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..296966d --- /dev/null +++ b/Dockerfile @@ -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"]