Trying to to use waypoint instead of a docker-compose setup. With a fairly common webapp / db containers services.
project = "project"
app "web" {
build {
use "docker" {
}
}
# Deploy to Docker
deploy {
use "docker" {
service_port = 8000
static_environment = {
"SECRET_KEY" : "changeme"
"DB_NAME" : "project"
"DB_USER" : "admin"
"DB_PASSWORD" : "Smartproject"
"DB_HOST" : db.deploy.container
"DB_PORT" : 5432
}
}
}
}
app "db" {
build {
use "docker-pull" {
image = "postgres"
tag = "12.2"
}
}
deploy {
use "docker" {
service_port = 5432
static_environment = {
"POSTGRES_DB" : "project"
"POSTGRES_USER" : "user"
"POSTGRES_PASSWORD" : "password"
}
}
}
}
As per the docker plugin documentation Plugin: Docker | Waypoint by HashiCorp, The db deploy stanza should output the id used by the db container that we can input to the webapp as the DB_HOST env variable. I was not able to find a way to accomplish this yet.
Really thankful for your help.