build(deploy): 添加多阶段 Dockerfile 以统一构建前后端

引入一个新的多阶段 `Dockerfile.build`,用于将 Flutter 前端和 Spring Boot 后端的构建过程整合到单个 Docker 镜像中。

- 第一阶段使用 Flutter 镜像构建 Web 静态资源。
- 第二阶段使用 Maven 镜像编译 Java 后端应用。
- 最终阶段将前两阶段的产物(Web 资源和 JAR 包)复制到一个精简的 JRE 基础镜像中,以创建最终的运行时镜像。

此变更简化了部署流程,并显著减小了最终生产镜像的体积。`docker-compose.yml` 已同步更新以使用此新的构建文件。
This commit is contained in:
史悦
2025-09-12 13:52:16 +08:00
parent 8c5089bc66
commit bd76264de2
2 changed files with 54 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ services:
image: ainoval/ainoval-server:latest
build:
context: ..
dockerfile: open/Dockerfile
dockerfile: open/Dockerfile.build
container_name: ainoval-server
env_file:
- ./production.env