resource "docker_image" "pgadmin" { name = "dpage/pgadmin4:7.8" } resource "docker_volume" "pgadmin" { name = "pgadmin" } resource "docker_container" "pgadmin" { image = docker_image.pgadmin.image_id name = "pgadmin" must_run = true env = [ "PGADMIN_DEFAULT_EMAIL=trygvis@inamo.no", "PGADMIN_DEFAULT_PASSWORD=123", ] networks_advanced { name = data.docker_network.traefik.name } networks_advanced { name = data.docker_network.public.name } dynamic "labels" { for_each = [ { label = "traefik.enable", value = "true" }, { label = "traefik.docker.network", value = data.docker_network.traefik.name }, { label = "traefik.http.routers.pgadmin.rule", value = "Host(`pgadmin.conflatorio.trygvis.io`)" }, { label = "traefik.http.routers.pgadmin.entrypoints", value = "websecure" }, { label = "traefik.http.routers.pgadmin.tls.certresolver", value = "linode" }, ] content { label = labels.value["label"] value = labels.value["value"] } } volumes { volume_name = docker_volume.pgadmin.name container_path = "/var/lib/pgadmin" } }