Files
Denozordec ed4d6f8a46
quality / commitlint (push) Skipped
CD / update-wiki (push) Failing after 8s
quality / changes (push) Successful in 7s
quality / docker-check (push) Skipped
quality / web (push) Successful in 1m8s
quality / api (push) Successful in 41s
CD / quality (push) Successful in 2m0s
CD / publish (push) Failing after 11m24s
chore: update Docker configuration and CI/CD setup
- Removed Dockerfile and Dockerfile.test as part of the transition to a pre-built image.
- Updated .dockerignore and .gitignore to reflect new build context and ignored files.
- Modified docker-compose.yml to use the new image for the application.
- Enhanced documentation in AGENTS.md and README.md to include CI/CD details and release process.
- Added new dependencies for commit linting and semantic release in package.json and pnpm-lock.yaml.

This commit streamlines the Docker setup and improves the CI/CD workflow with Gitea Actions.
2026-08-19 00:42:38 +07:00

118 lines
2.6 KiB
HCL

# Единая сборка образа CFDM (buildx bake: -f deploy/docker/docker-bake.hcl).
# context = "../.." — корень репо. Bake резолвит context от cwd (не от HCL),
# поэтому вызов из deploy/docker/ либо BUILDX_BAKE_FILE_RELATIVE_PATHS=1.
variable "REGISTRY" {
default = "git.shx.one/denozord"
}
variable "IMAGE_TAG" {
default = "latest"
}
variable "SHORT_SHA" {
default = "dev"
}
variable "SHA_FULL" {
default = ""
}
variable "VERSION" {
default = "dev"
}
variable "BUILD_TIME" {
default = ""
}
variable "CACHE_REF_NODE" {
default = ""
}
variable "BASE_NODE" {
default = "docker.io/library/node:22-alpine"
}
function "node-cache-from" {
params = []
result = notequal("", CACHE_REF_NODE) ? ["type=registry,ref=${CACHE_REF_NODE}"] : []
}
# Экспорт кэша — один writer на ref (параллельный cache-to в один ref ломает manifest).
function "node-cache-to-export" {
params = []
result = notequal("", CACHE_REF_NODE) ? ["type=registry,ref=${CACHE_REF_NODE},mode=max"] : []
}
function "image-tags" {
params = [name]
result = concat(
notequal("", SHA_FULL) ? [
"${REGISTRY}/${name}:${IMAGE_TAG}",
"${REGISTRY}/${name}:${SHORT_SHA}",
"${REGISTRY}/${name}:sha-${SHA_FULL}",
] : [
"${REGISTRY}/${name}:${IMAGE_TAG}",
"${REGISTRY}/${name}:${SHORT_SHA}",
],
notequal(VERSION, "dev") && notequal(VERSION, "") ? [
"${REGISTRY}/${name}:v${VERSION}",
"${REGISTRY}/${name}:${VERSION}",
] : []
)
}
group "default" {
targets = ["cfdm"]
}
target "_common" {
platforms = ["linux/amd64"]
pull = false
}
target "node-deps" {
inherits = ["_common"]
context = "../.."
dockerfile = "deploy/docker/cfdm/Dockerfile"
target = "deps"
args = {
BASE_NODE = BASE_NODE
}
cache-from = node-cache-from()
}
target "node-build" {
inherits = ["_common"]
context = "../.."
dockerfile = "deploy/docker/cfdm/Dockerfile"
target = "build"
args = {
BASE_NODE = BASE_NODE
}
contexts = {
deps = "target:node-deps"
}
cache-from = node-cache-from()
cache-to = node-cache-to-export()
}
target "cfdm" {
inherits = ["_common"]
context = "../.."
dockerfile = "deploy/docker/cfdm/Dockerfile"
target = "runtime"
args = {
BASE_NODE = BASE_NODE
VERSION = VERSION
GIT_SHA = notequal("", SHA_FULL) ? SHA_FULL : SHORT_SHA
BUILD_TIME = BUILD_TIME
}
contexts = {
build = "target:node-build"
}
cache-from = node-cache-from()
tags = concat(image-tags("cfdm"), image-tags("cloudflare-domain-manager"))
}