I have a problem when executing the following command
nomad [plan|run] file
I am currently trying that only the docker containers are connected to each other, regardless of the content of the internal code of the project, but it is impossible, since the network does not want to be built
output:
code:
job "project" {
datacenters = ["dc1"]
type = "service"
region = "global"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "postgres-project-group" {
network {
mode = "bridge"
port "postgres" {
to = 5432
host_network = "private"
}
}
service {
name = "project-data-store"
port = "postgres"
connect {
sidecar_service {}
}
}
task "postgres-project-task" {
driver = "docker"
config {
image = "postgres:13.4"
ports = "db"
}
env {
POSTGRES_PASSWORD = "project-password"
POSTGRES_DB = "project"
}
resources {
cpu = 2000
memory = 2000
}
}
}
group "ms-project-group" {
count = 1
network {
mode = "bridge"
port "project" {
to = 5000
host_network = "private"
}
}
service {
name = "ms-project"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "project-data-store"
local_bind_port = 5432
}
}
}
}
}
task "ms-project-task" {
driver = "docker"
config {
image = "docker/project"
port = "project"
}
resources {
cpu = 100
memory = 100
}
}
}
}