Update contract-check.nomad.hcl
Some checks failed
ci / Lint & typecheck (push) Successful in 32s
ci / Unit tests (push) Successful in 1m20s
deploy / build-and-deploy (push) Failing after 1m30s

This commit is contained in:
febux 2026-09-14 03:09:30 +03:00
parent b0a07cac53
commit 09030e6578

View file

@ -5,10 +5,12 @@
# docker0 host gateway 172.17.0.1 and the host-published ports # docker0 host gateway 172.17.0.1 and the host-published ports
# (15432/17379/5672/9000). The nginx edge cascade is unchanged. # (15432/17379/5672/9000). The nginx edge cascade is unchanged.
# #
# Env: the compose .env file (~/DealDocumentScreening/.env on the VPS) is # Env: a dedicated .env.nomad (copy of compose .env with hostnames rewritten
# bind-mounted into every container at /secrets/.env and sourced before the # to 172.17.0.1 + published ports) is bind-mounted at /secrets/.env and
# app starts. Shell parameter substitution rewrites compose hostnames # sourced before the app starts. Create it once on the VPS:
# (postgres, redis, rabbitmq, minio) to 172.17.0.1 + published ports. # cp ~/DealDocumentScreening/.env ~/DealDocumentScreening/.env.nomad
# # edit: @postgres:5432 @172.17.0.1:15432, @redis:6379 @172.17.0.1:17379,
# # @rabbitmq:5672 @172.17.0.1:5672, http://minio:9000 http://172.17.0.1:9000
# #
# Image tag uses ${IMAGE_TAG}, rendered by envsubst at submit time. # Image tag uses ${IMAGE_TAG}, rendered by envsubst at submit time.
# Registry auth: host-level `docker login` on the VPS (README §5). # Registry auth: host-level `docker login` on the VPS (README §5).
@ -66,7 +68,6 @@ job "contract-check" {
} }
} }
# One-shot migrations before the API starts.
task "migrate" { task "migrate" {
lifecycle { lifecycle {
hook = "prestart" hook = "prestart"
@ -82,9 +83,9 @@ job "contract-check" {
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -100,15 +101,15 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-api:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-api:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export REDIS_URL=$${REDIS_URL/@redis:/@172.17.0.1:17379:}; export RABBITMQ_URL=$${RABBITMQ_URL/@rabbitmq:/@172.17.0.1:5672:}; export S3_ENDPOINT_URL=http://172.17.0.1:9000; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.api"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.api"]
ports = ["http"] ports = ["http"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -144,14 +145,14 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-extract:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-extract:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export RABBITMQ_URL=$${RABBITMQ_URL/@rabbitmq:/@172.17.0.1:5672:}; export S3_ENDPOINT_URL=http://172.17.0.1:9000; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_extract"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_extract"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -185,14 +186,14 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-analyze:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-analyze:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export RABBITMQ_URL=$${RABBITMQ_URL/@rabbitmq:/@172.17.0.1:5672:}; export S3_ENDPOINT_URL=http://172.17.0.1:9000; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_analyze"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_analyze"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -226,14 +227,14 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-prescreen:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-prescreen:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export RABBITMQ_URL=$${RABBITMQ_URL/@rabbitmq:/@172.17.0.1:5672:}; export S3_ENDPOINT_URL=http://172.17.0.1:9000; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_prescreen"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_prescreen"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -267,14 +268,14 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-billing:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-billing:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_billing"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_billing"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }
@ -308,14 +309,14 @@ job "contract-check" {
config { config {
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-notify:${IMAGE_TAG}" image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-notify:${IMAGE_TAG}"
command = "sh" command = "sh"
args = ["-c", "set -a; . /secrets/.env; set +a; export DATABASE_URL=$${DATABASE_URL/@postgres:/@172.17.0.1:15432:}; export RABBITMQ_URL=$${RABBITMQ_URL/@rabbitmq:/@172.17.0.1:5672:}; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_notify"] args = ["-c", "set -a; . /secrets/.env; set +a; export APP_VERSION=${IMAGE_TAG}; exec python -m src.contract_check.worker_notify"]
mounts = [ mounts = [
{ {
type = "bind" type = "bind"
target = "/secrets/.env" target = "/secrets/.env"
source = "/root/DealDocumentScreening/.env" source = "/root/DealDocumentScreening/.env.nomad"
read_only = true readonly = true
}, }
] ]
} }