Update contract-check.nomad.hcl
This commit is contained in:
parent
b0a07cac53
commit
09030e6578
1 changed files with 47 additions and 46 deletions
|
|
@ -5,10 +5,12 @@
|
|||
# docker0 host gateway 172.17.0.1 and the host-published ports
|
||||
# (15432/17379/5672/9000). The nginx edge cascade is unchanged.
|
||||
#
|
||||
# Env: the compose .env file (~/DealDocumentScreening/.env on the VPS) is
|
||||
# bind-mounted into every container at /secrets/.env and sourced before the
|
||||
# app starts. Shell parameter substitution rewrites compose hostnames
|
||||
# (postgres, redis, rabbitmq, minio) to 172.17.0.1 + published ports.
|
||||
# Env: a dedicated .env.nomad (copy of compose .env with hostnames rewritten
|
||||
# to 172.17.0.1 + published ports) is bind-mounted at /secrets/.env and
|
||||
# sourced before the app starts. Create it once on the VPS:
|
||||
# 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.
|
||||
# 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" {
|
||||
lifecycle {
|
||||
hook = "prestart"
|
||||
|
|
@ -82,9 +83,9 @@ job "contract-check" {
|
|||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -100,15 +101,15 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-api:${IMAGE_TAG}"
|
||||
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"]
|
||||
mounts = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -144,14 +145,14 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-extract:${IMAGE_TAG}"
|
||||
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 = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -185,14 +186,14 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-analyze:${IMAGE_TAG}"
|
||||
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 = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -226,14 +227,14 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-prescreen:${IMAGE_TAG}"
|
||||
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 = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -267,14 +268,14 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-billing:${IMAGE_TAG}"
|
||||
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 = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -308,14 +309,14 @@ job "contract-check" {
|
|||
config {
|
||||
image = "p2gnl.mu-dungeon.xyz/admin-git/contract-check-worker-notify:${IMAGE_TAG}"
|
||||
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 = [
|
||||
{
|
||||
type = "bind"
|
||||
target = "/secrets/.env"
|
||||
source = "/root/DealDocumentScreening/.env"
|
||||
read_only = true
|
||||
},
|
||||
source = "/root/DealDocumentScreening/.env.nomad"
|
||||
readonly = true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue