56 lines
1.0 KiB
HCL
56 lines
1.0 KiB
HCL
data "docker_registry_image" "nginx-lb" {
|
|
name = "nginx:alpine"
|
|
}
|
|
|
|
resource "docker_image" "nginx-lb" {
|
|
name = data.docker_registry_image.nginx-lb.name
|
|
pull_triggers = [data.docker_registry_image.nginx-lb.sha256_digest]
|
|
}
|
|
|
|
resource "docker_network" "nginx-lb" {
|
|
name = "nginx-lb"
|
|
}
|
|
|
|
resource "docker_container" "nginx-lb" {
|
|
image = docker_image.nginx-lb.latest
|
|
name = "nginx-lb"
|
|
|
|
mounts {
|
|
target = "/etc/nginx/nginx.conf"
|
|
source = "/share/appdata/nginx-lb/nginx.conf"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/etc/nginx/config"
|
|
source = "/share/appdata/nginx-lb/conf"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/etc/nginx/certs"
|
|
source = "/share/appdata/nginx-lb/certs"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/var/www/acme-challenge-root"
|
|
source = "/share/appdata/nginx-lb/certbot"
|
|
type = "bind"
|
|
}
|
|
|
|
restart = "always"
|
|
|
|
networks_advanced {
|
|
name = docker_network.bridge.name
|
|
ipv4_address = "192.168.2.115"
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
ulimit,
|
|
log_opts
|
|
]
|
|
}
|
|
}
|