job "gitea" { datacenters = ["dc1"] group "gitea" { count = 1 volume "gitea-data" { type = "host" read_only = false source = "gitea-data" } network { mode = "bridge" port "ssh" { static = 22 } # port "http" { # static = 3000 # to = 3000 # } } service { name = "gitea-frontend" port = "3000" connect { sidecar_service {} } # check { # name = "alive" # type = "tcp" # interval = "10s" # timeout = "2s" # } } service { name = "gitea-ssh" port = "ssh" # check { # name = "alive" # type = "tcp" # interval = "10s" # timeout = "2s" # } } service { name = "gitea-postgres-connector" connect { sidecar_service { proxy { upstreams { # Required destination_name = "postgres" local_bind_port = "5432" # Optional local_bind_address = "127.0.0.1" } } } } } task "gitea" { driver = "docker" config { ports = ["ssh"] image = "gitea/gitea:1.14.2" volumes = [ "/etc/timezone:/etc/timezone:ro", "/etc/localtime:/etc/localtime:ro" ] } volume_mount { volume = "gitea-data" destination = "/data" read_only = false } template { # Consul Template only works in template stanza. # We need it to fetch secret values from Consul. # The "env = true" parameter sets the environment with the data. # "destination" key is required but its value doesn't matter. data = <