## MONITOR PROXY
[[deployment]]
name = "monitor-proxy"
description = "An NGINX proxy for mogh.tech"
tags = ["monitor"]
config.server_id = "monitor-01"
config.network = "host"
config.restart = "unless-stopped"
config.image.type = "Image"
config.image.params.image = "jc21/nginx-proxy-manager"

[[deployment.config.volumes]]
local = "/data/nginx/data"
container = "/data"

[[deployment.config.volumes]]
local = "/data/nginx/letsencrypt"
container = "/etc/letsencrypt"

## MONITOR MONGO
[[deployment]]
name = "monitor-mongo"
description = "shared mongo deployment"
tags = ["monitor"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "no"

[deployment.config.image]
type = "Image"
params.image = "mongo"

## MONITOR CORE
[[deployment]]
name = "monitor-core"
description = ""
tags = ["monitor"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "no"

[deployment.config.image]
type = "Image"
params.image = "mbecker2020/monitor_core"

## GRAFANA
[[deployment]]
name = "grafana"
description = "runs on port 3080"
tags = ["logging"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "unless-stopped"
extra_args = ["--user root"]

[deployment.config.image]
type = "Image"
params.image = "grafana/grafana"

[[deployment.config.volumes]]
local = "/data/grafana"
container = "/var/lib/grafana"

[[deployment.config.environment]]
variable = "GF_SERVER_HTTP_PORT"
value = "3080"

[[deployment.config.labels]]
variable = "vector"
value = "key-value"

## LOKI
[[deployment]]
name = "loki"
description = "runs on 3100"
tags = ["logging"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "unless-stopped"
extra_args = ["--user root"]

[deployment.config.image]
type = "Image"
params.image = "grafana/loki"

[[deployment.config.volumes]]
local = "/data/loki"
container = "/loki"

[[deployment]]
name = "tempo"
description = "OTLP: port 4317. HTTP: 3200"
tags = ["logging"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "unless-stopped"
command = "-server.http-listen-port=3200 -server.grpc-listen-port=9096 --storage.trace.backend=local --storage.trace.local.path=/tmp/tempo/traces --storage.trace.wal.path=/tmp/tempo/wal"
extra_args = ["--user root"]

[deployment.config.image]
type = "Image"
params.image = "grafana/tempo"

[[deployment.config.volumes]]
local = "/data/tempo"
container = "/tmp/tempo"

[[deployment.config.labels]]
variable = "vector"
value = "key-value"

## VECTOR
[[deployment]]
name = "vector"
description = "collects the docker logs (and alert endpoint)"
tags = ["logging"]

[deployment.config]
server_id = "monitor-01"
network = "host"
restart = "unless-stopped"
command = "--config /etc/vector/*.toml"
extra_args = ["--user root"]

[deployment.config.image]
type = "Image"
params.image = "timberio/vector:latest-debian"

[[deployment.config.volumes]]
local = "/root/.config/vector"
container = "/etc/vector"

[[deployment.config.volumes]]
local = "/data/vector"
container = "/var/lib/vector"

[[deployment.config.volumes]]
local = "/var/run/docker.sock"
container = "/var/run/docker.sock"

[[deployment.config.labels]]
variable = "vector"
value = "key-value"

## MONITOR CORE DEV
[[deployment]]
name = "monitor-core-dev"
description = "runs on 9001"
tags = ["monitor", "dev"]

[deployment.config]
server_id = "monitor-01"
redeploy_on_build = true
network = "host"
restart = "no"

[deployment.config.image]
type = "Build"
params.build_id = "monitor_core"

[[deployment.config.volumes]]
local = "/root/.config/monitor/dev.core.config.toml"
container = "/config/config.toml"

[[deployment.config.volumes]]
local = "/data/repos/monitor-dev-frontend/frontend/dist"
container = "/frontend"

[[deployment.config.labels]]
variable = "vector"
value = "rust"

## MONITOR FRONTEND
[[deployment]]
name = "monitor-frontend"
description = ""
tags = ["monitor", "frontend"]

[deployment.config]
server_id = "monitor-01"
redeploy_on_build = true
network = "host"
restart = "unless-stopped"
image.type = "Build"
image.params.build = "monitor_frontend"

## MONITOR DEV FRONTEND
[[deployment]]
name = "monitor-dev-frontend"
description = ""
tags = ["monitor", "dev", "frontend"]

[deployment.config]
server_id = "monitor-01"
redeploy_on_build = true
network = "host"
restart = "unless-stopped"
image.type = "Build"
image.params.build = "monitor_frontend_dev"

[[deployment.config.environment]]
variable = "PORT"
value = "4175"