refactor(docker): 重构容器配置并添加PostgreSQL支持

- 将Dockerfile重命名为Dockerfile.php以明确用途
- 新增Dockerfile.postgres用于构建带pgvector扩展的PostgreSQL镜像
- 拆分初始化SQL脚本为mysql和postgres专用版本
- 更新docker-compose配置以使用新的构建文件
- 修改init_env.sh脚本适配新的初始化文件路径

重构目的是提高配置的模块化和可维护性,同时为系统添加PostgreSQL向量搜索支持。
This commit is contained in:
Kenny Yang committed 2025-05-29 01:47:28 +08:00
1 parent 4c9e71955e
commit ce13de6253
6 files changed
+38 -5

No files matched your search

+7 -4
View File
@@ -21,7 +21,7 @@ services:
php:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile.php
args:
PHP_VERSION: "8.2"
container_name: php
@@ -34,7 +34,7 @@ services:
php74:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile.php
args:
PHP_VERSION: "7.4"
container_name: php74
@@ -80,7 +80,9 @@ services:
- docker_network1
postgres:
image: postgres:14
build:
context: .
dockerfile: Dockerfile.postgres
container_name: postgresql
restart: always
environment:
@@ -90,6 +92,7 @@ services:
ports:
- 9332:5432
volumes:
- ./postgresql:/var/lib/postgresql
- ./postgresql/data:/var/lib/postgresql/data
- ./postgresql/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- docker_network1