-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
124 lines (102 loc) · 3.55 KB
/
docker-bake.hcl
File metadata and controls
124 lines (102 loc) · 3.55 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Docker Bake configuration for Packmind images
// Usage:
// Build all (single platform): EDITION=oss docker buildx bake --load
// Build for release (multi-platform): EDITION=oss docker buildx bake release --push
//
// Set EDITION to "oss" or "proprietary" to build the corresponding images.
// ============================================================================
// Variables
// ============================================================================
variable "VERSION" {
default = "latest"
}
variable "SHA" {
default = ""
}
variable "REGISTRY" {
default = "packmind"
}
variable "EDITION" {
default = "oss"
}
variable "IMAGE_NAME_SUFFIX" {
// For OSS: -oss (results in packmind/api-oss for continuous builds)
// For proprietary: -proprietary (results in packmind/api-proprietary)
// For others: -${EDITION} (results in packmind/api-${EDITION})
default = ""
}
variable "VERSION_SUFFIX" {
// For OSS: empty string (results in version like 1.4.2)
// For proprietary: -enterprise (results in version like 1.4.2-enterprise)
// For others: -${EDITION} (results in version like 1.4.2-${EDITION})
default = ""
}
// ============================================================================
// Groups
// ============================================================================
group "default" {
targets = ["api", "frontend", "mcp"]
}
group "release" {
targets = ["api-release", "frontend-release", "mcp-release"]
}
// ============================================================================
// Shared target configuration
// ============================================================================
target "_common" {
context = "."
}
target "_platforms-release" {
platforms = ["linux/amd64", "linux/arm64"]
}
// ============================================================================
// API Target
// ============================================================================
target "api" {
inherits = ["_common"]
dockerfile = "dockerfile/Dockerfile.api"
args = {
EDITION = "${EDITION}"
}
tags = [
"${REGISTRY}/api${IMAGE_NAME_SUFFIX}:${VERSION}${VERSION_SUFFIX}",
"${REGISTRY}/api${IMAGE_NAME_SUFFIX}:latest${VERSION_SUFFIX}",
notequal("", SHA) ? "${REGISTRY}/api${IMAGE_NAME_SUFFIX}:${SHA}" : "",
]
platforms = ["linux/amd64"]
}
target "api-release" {
inherits = ["api", "_platforms-release"]
}
// ============================================================================
// Frontend Target
// ============================================================================
target "frontend" {
inherits = ["_common"]
dockerfile = "dockerfile/Dockerfile.frontend"
tags = [
"${REGISTRY}/frontend${IMAGE_NAME_SUFFIX}:${VERSION}${VERSION_SUFFIX}",
"${REGISTRY}/frontend${IMAGE_NAME_SUFFIX}:latest${VERSION_SUFFIX}",
notequal("", SHA) ? "${REGISTRY}/frontend${IMAGE_NAME_SUFFIX}:${SHA}" : "",
]
platforms = ["linux/amd64"]
}
target "frontend-release" {
inherits = ["frontend", "_platforms-release"]
}
// ============================================================================
// MCP Server Target
// ============================================================================
target "mcp" {
inherits = ["_common"]
dockerfile = "dockerfile/Dockerfile.mcp"
tags = [
"${REGISTRY}/mcp${IMAGE_NAME_SUFFIX}:${VERSION}${VERSION_SUFFIX}",
"${REGISTRY}/mcp${IMAGE_NAME_SUFFIX}:latest${VERSION_SUFFIX}",
notequal("", SHA) ? "${REGISTRY}/mcp${IMAGE_NAME_SUFFIX}:${SHA}" : "",
]
platforms = ["linux/amd64"]
}
target "mcp-release" {
inherits = ["mcp", "_platforms-release"]
}