forked from Tinywan/tinywan-typephp-webman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.build.yml
More file actions
63 lines (60 loc) · 2.35 KB
/
Copy pathdocker-compose.build.yml
File metadata and controls
63 lines (60 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# ============================================================
# TypePHP Webman — 独立 Docker 构建环境编排
# ============================================================
# 三个完全独立的构建环境镜像,工具链全置于镜像内:
# tinywan/typephp-linux-x64 Linux glibc 动态链接环境
# tinywan/typephp-linux-x64-static Linux musl 全静态链接环境
# tinywan/typephp-windows-x64 Windows MSVC 动态链接环境
#
# 使用方式:
# 1. 构建环境镜像 (一次性):
# docker compose -f docker-compose.build.yml build linux-dynamic
# docker compose -f docker-compose.build.yml build linux-static
# docker compose -f docker-compose.build.yml build windows
#
# 2. 挂载当前项目直接编译打包 (产物生成到 dist/):
# docker compose -f docker-compose.build.yml run --rm linux-dynamic
# docker compose -f docker-compose.build.yml run --rm linux-static
# docker compose -f docker-compose.build.yml run --rm windows
# ============================================================
services:
# =========================================================
# 1. Linux x64 动态链接构建环境
# =========================================================
linux-dynamic:
build:
context: docker
dockerfile: Dockerfile.linux-dynamic
args:
TYPEPHP_VERSION: v0.8.0
image: tinywan/typephp-linux-x64:v0.8.0
container_name: typephp-builder-linux-dynamic
volumes:
- ./:/app
working_dir: /app
# =========================================================
# 2. Linux x64 全静态链接构建环境
# =========================================================
linux-static:
build:
context: docker
dockerfile: Dockerfile.linux-static
args:
TYPEPHP_VERSION: v0.8.0
image: tinywan/typephp-linux-x64-static:v0.8.0
container_name: typephp-builder-linux-static
volumes:
- ./:/app
working_dir: /app
# =========================================================
# 3. Windows x64 MSVC 动态链接构建环境 (需要 Windows 容器模式)
# =========================================================
windows:
build:
context: docker
dockerfile: Dockerfile.windows
image: tinywan/typephp-windows-x64
container_name: typephp-builder-windows
volumes:
- ./:C:\app
working_dir: C:\app