# 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. # # API Dockerfile ends with `final` and exposes scratch `migrate-bundle`. # Context for API is repo root (Dockerfile COPY paths assume that). variable "REGISTRY" {} variable "TAG" {} group "default" { targets = ["api", "ui", "migrate"] } target "api" { context = "cwd://" dockerfile = "VigilCareRecordsAPI/Dockerfile" target = "final" tags = ["${REGISTRY}/vigilcare-records-api:${TAG}", "${REGISTRY}/vigilcare-records-api:latest"] cache-from = ["type=registry,ref=${REGISTRY}/vigilcare-records-api:buildcache"] cache-to = ["type=registry,ref=${REGISTRY}/vigilcare-records-api:buildcache,mode=max"] } target "ui" { context = "cwd://vigilcare-records-web" dockerfile = "Dockerfile" target = "final" tags = ["${REGISTRY}/vigilcare-records-dashboard:${TAG}", "${REGISTRY}/vigilcare-records-dashboard:latest"] cache-from = ["type=registry,ref=${REGISTRY}/vigilcare-records-dashboard:buildcache"] cache-to = ["type=registry,ref=${REGISTRY}/vigilcare-records-dashboard:buildcache,mode=max"] } target "migrate" { context = "cwd://" dockerfile = "VigilCareRecordsAPI/Dockerfile" target = "migrate-bundle" tags = ["vigilcare-records-migrate-bundle:local"] cache-from = ["type=registry,ref=${REGISTRY}/vigilcare-records-api:buildcache"] # no cache-to — api already exports this Dockerfile at mode=max }