How can I address my “db” container from my “backend” container in a two “app” setup in waypoint. Is there a way to set the name of the “db” app’s deployed container so that it can be referenced in another container?
I am using a single machine docker setup here.
waypoint.hcl
project = "nginx-http-golang-dev"
app "db" {
config {
env = {
POSTGRES_USER = "postgres"
POSTGRES_PASSWORD = "postgres"
}
}
build {
use "docker-pull" {
image = "postgres"
tag = "13"
}
}
deploy {
use "docker" {
name = db <-- this is not allowed
service_port = 5432
}
}
}
app "backend" {
path = "./backend"
config = {
env = {
PG_DSN = "host=db\ port=5432\ user=postgres\ dbname=postgres\ sslmode=disable\ password=postgres" <-- I want to address my "db" container from here.
}
}
build {
use "docker" {
}
}
deploy {
use "docker" {
service_port = 80
binds = ["${path.app}:/workspace:cached"]
}
}
}