From fa4a44384d166404d628d13c806521940cb7433c Mon Sep 17 00:00:00 2001 From: mintiang Date: Wed, 19 Nov 2025 15:09:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9E=84=E5=BB=BAdocker?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E7=9A=84Dockerfile=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=95=9C=E5=83=8F=EF=BC=9Adocker=20build=20-?= =?UTF-8?q?t=20pixpro=20.=20=E5=88=9B=E5=BB=BA=E5=AE=B9=E5=99=A8=EF=BC=9Ad?= =?UTF-8?q?ocker=20run=20-d=20--name=20pixpro=20-v=20=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=B7=AF=E5=BE=84:/var/www/html/i=20-u=20roo?= =?UTF-8?q?t=20-p=20=E7=AB=AF=E5=8F=A3=E5=8F=B7:80=20pixpro:latest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2480dab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM php:8.1-apache + +# 设置工作目录 +WORKDIR /var/www/html +COPY pixpro /var/www/html/ +# 安装系统依赖 +RUN apt-get update && apt-get install -y \ + libmagickwand-dev \ + libzip-dev \ + unzip \ + pkg-config \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + && rm -rf /var/lib/apt/lists/* + +# 安装 PHP 扩展 +RUN docker-php-ext-install exif pcntl mysqli \ + && pecl install imagick \ + && docker-php-ext-enable imagick \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install gd + +# 设置 PHP 配置,屏蔽 Notice +RUN echo "display_errors = Off" >> /usr/local/etc/php/conf.d/docker-custom.ini \ + && echo "error_reporting = E_ALL & ~E_NOTICE" >> /usr/local/etc/php/conf.d/docker-custom.ini + +# 开启 Apache Rewrite(如果需要) +RUN a2enmod rewrite + +# 暴露端口 +EXPOSE 80 + +# 默认启动 Apache +CMD ["apache2-foreground"] \ No newline at end of file