fix: [nomad-step-5] edge caddy task fails to clone Forgejo from 127.0.0.1:3000 under bridge network (#1034)

This commit is contained in:
dev-qwen2 2026-04-19 09:31:02 +00:00
parent b09463b162
commit 2648c401f4

View file

@ -123,6 +123,19 @@ job "edge" {
# Caddyfile via Nomad service discovery (S5-fix-7, issue #1018)
# Renders staging upstream from Nomad service registration instead of
# hardcoded staging:80. Caddy picks up /local/Caddyfile via entrypoint.
# Forge URL via Nomad service discovery (issue #1034) resolves forgejo
# service address/port dynamically for bridge network compatibility.
template {
destination = "local/forge.env"
env = true
change_mode = "restart"
data = <<EOT
{{ range service "forgejo" -}}
FORGE_URL=http://{{ .Address }}:{{ .Port }}
{{- end }}
EOT
}
template {
destination = "local/Caddyfile"
change_mode = "restart"
@ -174,7 +187,6 @@ EOT
# Non-secret env
env {
FORGE_URL = "http://127.0.0.1:3000"
FORGE_REPO = "disinto-admin/disinto"
DISINTO_CONTAINER = "1"
PROJECT_NAME = "disinto"
@ -233,7 +245,6 @@ EOT
# Non-secret env
env {
DISPATCHER_BACKEND = "nomad"
FORGE_URL = "http://127.0.0.1:3000"
FORGE_REPO = "disinto-admin/disinto"
FORGE_OPS_REPO = "disinto-admin/disinto-ops"
PRIMARY_BRANCH = "main"