nextcloud and other minor changes

This commit is contained in:
Nemo 2019-03-09 13:22:54 +05:30
parent 995fb96611
commit 6ec37264dc
4 changed files with 68 additions and 1 deletions

View File

@ -18,6 +18,12 @@ resource "docker_container" "nodeexporter" {
read_only = true
}
volumes {
host_path = "/mnt/xwing"
container_path = "/host/mnt"
read_only = true
}
command = [
"--path.procfs=/host/proc",
"--path.sysfs=/host/sys",

60
nextcloud.tf Normal file
View File

@ -0,0 +1,60 @@
module "nextcloud-db" {
source = "modules/postgres"
name = "nextcloud"
password = "${var.nextcloud-db-password}"
}
module "nextcloud-container" {
source = "modules/container"
name = "nextcloud"
image = "nextcloud:15-apache"
volumes = [{
container_path = "/var/www/html"
host_path = "/mnt/xwing/data/nextcloud"
}]
env = [
"POSTGRES_DB=nextcloud",
"POSTGRES_USER=nextcloud",
"POSTGRES_PASSWORD=${var.nextcloud-db-password}",
"POSTGRES_HOST=postgres",
"NEXTCLOUD_TRUSTED_DOMAINS=c.${var.root-domain},nextcloud.${var.root-domain}",
"NEXTCLOUD_UPDATE=0",
"REDIS_HOST=nextcloud-redis",
]
resource {
memory = 1024
memory_swap = 1024
}
web {
expose = true
port = 80
host = "c.${var.root-domain}"
}
# module.docker.traefik-network-id,
networks = "${list(
data.docker_network.bridge.id,
module.db.postgres-network-id
)}"
}
module "nextcloud-redis" {
name = "nextcloud-redis"
source = "modules/container"
image = "redis:alpine"
networks = ["${data.docker_network.bridge.id}"]
# ThisSucks
web {
expose = "false"
}
resource {
memory = 256
memory_swap = 256
}
}

View File

@ -1,5 +1,5 @@
provider "docker" {
host = "tcp://docker.vpn.bb8.fun:2376"
host = "tcp://docker.in.bb8.fun:2376"
cert_path = "./secrets/tatooine"
version = "~> 2.0.0"
}

View File

@ -96,3 +96,4 @@ variable "outline_slack_verification_token" {}
variable "syncserver_secret" {}
variable "pihole_password" {}
variable "nextcloud-db-password" {}