Skip to content

Instantly share code, notes, and snippets.

@eduardosramos
Created August 23, 2022 17:59
Show Gist options
  • Save eduardosramos/34814e14e2cb029f6109f8ebff659c4d to your computer and use it in GitHub Desktop.
Save eduardosramos/34814e14e2cb029f6109f8ebff659c4d to your computer and use it in GitHub Desktop.
# Antes, é preciso criar no client.hcl o caminho para os volumes abaixo.
job "sonarqube"{
datacenters = ["dc1"]
type = "service"
group "sonarqube" {
count = 1
network {
port "http" {
to = 9000
static = 80
}
}
volume "sonarqube_extensions" {
type = "host"
read_only = false
source = "sonarqube_extensions"
}
volume "sonarqube_data" {
type = "host"
read_only = false
source = "sonarqube_data"
}
volume "sonarqube_temp" {
type = "host"
read_only = false
source = "sonarqube_temp"
}
volume "sonarqube_conf" {
type = "host"
read_only = false
source = "sonarqube_conf"
}
task "sonarqube" {
driver = "docker"
config {
image = "sonarqube:9.6.0-community"
ports = ["http"]
auth_soft_fail = true
}
volume_mount {
volume = "sonarqube_data"
destination = "/opt/sonarqube/data"
read_only = false
}
volume_mount {
volume = "sonarqube_temp"
destination = "/opt/sonarqube/temp"
read_only = false
}
volume_mount {
volume = "sonarqube_conf"
destination = "/opt/sonarqube/conf"
read_only = false
}
volume_mount {
volume = "sonarqube_extensions"
destination = "/opt/sonarqube/extensions"
read_only = false
}
resources {
cpu = 5000
memory = 4096
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment