# iiEasy Nomad Job # Deploy: nomad job run -var "nomad_host=192.168.1.16" nomad/iieasy.nomad.hcl variables { # Docker image names (must exist on Nomad node - build via deploy-nomad.sh) frontend_image = "iieasy-frontend:latest" strapi_image = "iieasy-strapi:latest" datacenter = "dc1" } job "iieasy" { datacenters = [var.datacenter] type = "service" group "postgres" { count = 1 volume "postgres_data" { type = "host" source = "iieasy-postgres-data" read_only = false } network { port "db" { static = 5432 } } service { name = "iieasy-postgres" port = "db" provider = "nomad" check { type = "script" name = "postgres-ready" command = "pg_isready" args = ["-U", "strapi"] interval = "5s" timeout = "5s" } } task "postgres" { driver = "docker" config { image = "postgres:16-alpine" ports = ["db"] } env { POSTGRES_USER = "strapi" POSTGRES_PASSWORD = "strapi" POSTGRES_DB = "strapi" } volume_mount { volume = "postgres_data" destination = "/var/lib/postgresql/data" read_only = false } resources { cpu = 256 memory = 512 } } } group "strapi" { count = 1 volume "strapi_uploads" { type = "host" source = "iieasy-strapi-uploads" read_only = false } network { port "http" { static = 1337 } } service { name = "iieasy-strapi" port = "http" provider = "nomad" } task "strapi" { driver = "docker" config { image = var.strapi_image ports = ["http"] } template { data = <