diff --git a/.gitignore b/.gitignore index ce34f69..2067d33 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,26 @@ *.log .env config/install/lock/install.lock -public/upload +# 忽略 storage 目录下的所有内容 +public/storage/* +# 但保留 .gitkeep 文件和必要的子目录 +!public/storage/.gitkeep +!public/storage/upload/ +!public/storage/build/ + +# 忽略子目录下的所有内容 +public/storage/upload/* +public/storage/build/* + +# 但保留子目录中的 .gitkeep 文件 +!public/storage/upload/.gitkeep +!public/storage/build/.gitkeep + public/docs public/conf public/WowOss.exe +build/* +!build/.gitkeep app/index/controller/Test.php composer.phar app/test/ @@ -17,7 +33,7 @@ ul.db /app/common/command/curd/migrate_output.php /dist /composer.lock -/public/storage + /build /.VSCodeCounter result.txt diff --git a/Dockerfile b/Dockerfile index 398782c..9f2cb96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,16 +9,8 @@ RUN apt-get update # 安装nginx RUN apt-get install -y nginx -# 安装ffmpeg -# RUN apt-get install -y ffmpeg - -# 安装redis -# RUN apt-get install -y redis-server - -# 安装git -# RUN apt-get install -y git - ADD --chmod=0755 https://delivery.ulthon.com/install-php-extensions /usr/local/bin/ +# ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN install-php-extensions pdo_mysql RUN install-php-extensions gd @@ -33,6 +25,13 @@ RUN install-php-extensions pcntl # 清理默认 Nginx 配置 RUN rm /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default + +# 安装其他需要的依赖 +# RUN apt-get install -y ffmpeg +# RUN apt-get install -y libreoffice +# RUN apt-get install -y redis-server +# RUN apt-get install -y git + # 设置工作目录 WORKDIR /var/www/html # 将当前目录下的文件拷贝到工作目录 @@ -41,24 +40,9 @@ COPY . /var/www/html # 内部安装compsoer并安装依赖,如果不需要可以注释掉 # RUN install-php-extensions @composer -# 创建runtime目录 -RUN mkdir -p /var/www/html/runtime -RUN chmod -R 777 /var/www/html/runtime VOLUME /var/www/html/runtime - -# 创建storage目录 -RUN mkdir -p /var/www/html/public/storage -RUN chmod -R 777 /var/www/html/public/storage VOLUME /var/www/html/public/storage - -# 创建build目录 -RUN mkdir -p /var/www/html/public/build -RUN chmod -R 777 /var/www/html/public/build VOLUME /var/www/html/public/build - -# 创建storage(safe)目录 -RUN mkdir -p /var/www/html/storage -RUN chmod -R 777 /var/www/html/storage VOLUME /var/www/html/storage # 挂载主目录,也可以选择直接挂载主目录,可以把上面的几个指定的目录删掉 @@ -67,7 +51,6 @@ VOLUME /var/www/html/storage # 暴露 Nginx 端口 EXPOSE 80 -# RUN chmod +x /var/www/html/docker/run.sh # 启动 Nginx PHP 然后阻塞 diff --git a/public/storage/.gitkeep b/public/storage/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/storage/build/.gitkeep b/public/storage/build/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/storage/upload/.gitkeep b/public/storage/upload/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/storage/.gitkeep b/storage/.gitkeep new file mode 100644 index 0000000..e69de29