68 lines
1.5 KiB
Terraform
68 lines
1.5 KiB
Terraform
|
|
data "docker_registry_image" "borg" {
|
|
name = "borgwarehouse/borgwarehouse:latest"
|
|
}
|
|
|
|
resource "docker_image" "borg" {
|
|
name = data.docker_registry_image.borg.name
|
|
pull_triggers = [data.docker_registry_image.borg.sha256_digest]
|
|
}
|
|
|
|
resource "docker_container" "borg" {
|
|
image = docker_image.borg.image_id
|
|
name = "borg"
|
|
restart = "always"
|
|
|
|
env = [
|
|
"WEB_SERVER_PORT=3000",
|
|
"SSH_SERVER_PORT=2222",
|
|
"FQDN=borg.rescla.me",
|
|
"FQDN_LAN=192.168.3.56",
|
|
"NEXTAUTH_URL=https://borg.rescla.me",
|
|
"NEXTAUTH_SECRET=BO/oRBi7pGunZIgNdlaJgmA/+TVc57q4yZUi3mbF4NE=",
|
|
"UNIX_USER=borgwarehouse",
|
|
"PUID=3006",
|
|
"PGID=3006",
|
|
"CONFIG_PATH=/home/borgwarehouse/app/config",
|
|
"BORG_REPOSITORY_PATH=/home/borgwarehouse/repos",
|
|
"SSH_PATH=/home/borgwarehouse/.ssh",
|
|
"SSH_HOST=/etc/ssh",
|
|
"NEXT_TELEMETRY_DISABLED=1"
|
|
]
|
|
|
|
mounts {
|
|
target = "/home/borgwarehouse/app/config"
|
|
source = "/var/lib/containers/borg/config"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/home/borgwarehouse/.ssh"
|
|
source = "/var/lib/containers/borg/sshkeys/clients"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/etc/ssh"
|
|
source = "/var/lib/containers/borg/sshkeys/host"
|
|
type = "bind"
|
|
}
|
|
|
|
volumes {
|
|
container_path = "/home/borgwarehouse/repos"
|
|
volume_name = docker_volume.truenas-borg.name
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
ulimit,
|
|
log_opts
|
|
]
|
|
}
|
|
|
|
networks_advanced {
|
|
name = docker_network.container-public.name
|
|
ipv4_address = "192.168.3.56"
|
|
}
|
|
}
|