49 lines
1.0 KiB
HCL
49 lines
1.0 KiB
HCL
data "docker_registry_image" "elasticsearch" {
|
|
name = "docker.elastic.co/elasticsearch/elasticsearch-wolfi:9.1.5"
|
|
}
|
|
|
|
resource "docker_image" "elasticsearch" {
|
|
name = data.docker_registry_image.elasticsearch.name
|
|
pull_triggers = [data.docker_registry_image.elasticsearch.sha256_digest]
|
|
}
|
|
|
|
resource "docker_container" "elasticsearch" {
|
|
image = docker_image.elasticsearch.image_id
|
|
name = "elasticsearch"
|
|
|
|
restart = "always"
|
|
|
|
memory = 5000
|
|
memory_swap = 5000
|
|
|
|
mounts {
|
|
target = "/usr/share/elasticsearch/data"
|
|
source = "/var/lib/containers/elasticsearch/data"
|
|
type = "bind"
|
|
}
|
|
|
|
# mounts {
|
|
# target = "/usr/share/elasticsearch/config"
|
|
# source = "/var/lib/containers/elasticsearch/config"
|
|
# type = "bind"
|
|
# }
|
|
|
|
mounts {
|
|
target = "/usr/share/elasticsearch/log"
|
|
source = "/var/lib/containers/elasticsearch/log"
|
|
type = "bind"
|
|
}
|
|
|
|
networks_advanced {
|
|
name = docker_network.container-public.name
|
|
ipv4_address = "192.168.3.46"
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
ulimit,
|
|
log_opts
|
|
]
|
|
}
|
|
}
|