Files
vigilcare-clinical/docs/CICD/templates/docker-bake.hcl
T
Trent 1c1065938f
CI / changes (push) Successful in 47s
CI / frontend (push) Skipped
CI / backend (push) Successful in 43m10s
Pull MinIO from the Gitea-mirrored pgsty image after upstream Hub/Quay removal.
2026-09-30 23:09:01 +08:00

47 lines
1.6 KiB
HCL

# Kit template — copy to the repo root (or pass -f).
# Invoked from the repo root. cwd:// keeps contexts relative to that
# working directory, not this file.
#
# CD must cap the builder cgroup (scripts/cap-buildx-builder.sh)
# and bake one target at a time. The runner host also runs Gitea.
#
# The API Dockerfile must end with `final` and expose a slim
# `migrate-bundle` stage (scratch + /out/migrate-api + CMD). Do not bake the
# SDK `migrate` stage into the daemon.
#
# Substitute: <owner>, <repo-slug>, api/, web/ (drop ui target if no SPA image).
variable "REGISTRY" {}
variable "TAG" {}
group "default" {
targets = ["api", "ui", "migrate"]
}
target "api" {
context = "cwd://api"
dockerfile = "Dockerfile"
target = "final"
tags = ["${REGISTRY}/<repo-slug>-api:${TAG}", "${REGISTRY}/<repo-slug>-api:latest"]
cache-from = ["type=registry,ref=${REGISTRY}/<repo-slug>-api:buildcache"]
cache-to = ["type=registry,ref=${REGISTRY}/<repo-slug>-api:buildcache,mode=max"]
}
target "ui" {
context = "cwd://web"
dockerfile = "Dockerfile"
target = "final"
tags = ["${REGISTRY}/<repo-slug>-ui:${TAG}", "${REGISTRY}/<repo-slug>-ui:latest"]
cache-from = ["type=registry,ref=${REGISTRY}/<repo-slug>-ui:buildcache"]
cache-to = ["type=registry,ref=${REGISTRY}/<repo-slug>-ui:buildcache,mode=max"]
}
target "migrate" {
context = "cwd://api"
dockerfile = "Dockerfile"
target = "migrate-bundle"
tags = ["<repo-slug>-migrate-bundle:local"]
cache-from = ["type=registry,ref=${REGISTRY}/<repo-slug>-api:buildcache"]
# no cache-to — api already exports this Dockerfile at mode=max
}