-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
62 lines (53 loc) · 952 Bytes
/
Copy pathdocker-bake.hcl
File metadata and controls
62 lines (53 loc) · 952 Bytes
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
// Variables
variable "APP_NAME" {
default = "docker-bake-example"
}
variable "REGISTRY" {
default = "myregistry.io"
}
variable "VERSION" {
default = "1.0.0"
}
// Groups
group "default" {
targets = ["app-dev"]
}
group "production" {
targets = ["app-prod"]
}
group "all" {
targets = ["app-dev", "app-prod", "app-test"]
}
// Base target
target "base" {
dockerfile = "Dockerfile"
context = "."
}
// Development target
target "app-dev" {
inherits = ["base"]
target = "development"
tags = ["${REGISTRY}/${APP_NAME}:dev"]
}
// Production target
target "app-prod" {
inherits = ["base"]
target = "production"
tags = [
"${REGISTRY}/${APP_NAME}:${VERSION}",
"${REGISTRY}/${APP_NAME}:latest"
]
platforms = [
"linux/amd64",
"linux/arm64"
]
}
// Test target
target "app-test" {
inherits = ["base"]
target = "development"
tags = ["${REGISTRY}/${APP_NAME}:test"]
args = {
NODE_ENV = "test"
}
}