2019-03-09 07:52:54 +00:00
|
|
|
module "nextcloud-db" {
|
2021-10-15 12:54:13 +00:00
|
|
|
source = "./modules/postgres"
|
2019-03-09 07:52:54 +00:00
|
|
|
name = "nextcloud"
|
2021-10-15 12:54:13 +00:00
|
|
|
password = data.pass_password.nextcloud-db-password.password
|
2019-03-09 07:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module "nextcloud-container" {
|
2021-10-15 12:54:13 +00:00
|
|
|
source = "./modules/container"
|
2019-03-09 07:52:54 +00:00
|
|
|
name = "nextcloud"
|
2019-04-21 12:15:28 +00:00
|
|
|
image = "nextcloud:stable-apache"
|
2019-03-09 07:52:54 +00:00
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
volumes = [
|
|
|
|
{
|
|
|
|
container_path = "/var/www/html"
|
|
|
|
host_path = "/mnt/xwing/data/nextcloud"
|
|
|
|
},
|
|
|
|
]
|
2019-03-09 07:52:54 +00:00
|
|
|
|
|
|
|
env = [
|
|
|
|
"POSTGRES_DB=nextcloud",
|
|
|
|
"POSTGRES_USER=nextcloud",
|
2019-03-25 15:34:47 +00:00
|
|
|
"POSTGRES_PASSWORD=${data.pass_password.nextcloud-db-password.password}",
|
2019-03-09 07:52:54 +00:00
|
|
|
"POSTGRES_HOST=postgres",
|
|
|
|
"NEXTCLOUD_TRUSTED_DOMAINS=c.${var.root-domain},nextcloud.${var.root-domain}",
|
|
|
|
"NEXTCLOUD_UPDATE=0",
|
|
|
|
"REDIS_HOST=nextcloud-redis",
|
|
|
|
]
|
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
resource = {
|
2019-03-09 07:52:54 +00:00
|
|
|
memory = 1024
|
|
|
|
memory_swap = 1024
|
|
|
|
}
|
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
web = {
|
2019-03-09 07:52:54 +00:00
|
|
|
expose = true
|
|
|
|
port = 80
|
|
|
|
host = "c.${var.root-domain}"
|
|
|
|
}
|
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
networks = ["nextcloud", "postgres"]
|
2019-04-15 19:08:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "docker_network" "nextcloud" {
|
|
|
|
name = "nextcloud"
|
|
|
|
internal = true
|
2019-03-09 07:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module "nextcloud-redis" {
|
2019-08-11 18:57:44 +00:00
|
|
|
name = "nextcloud-redis"
|
2021-10-15 12:54:13 +00:00
|
|
|
source = "./modules/container"
|
2019-08-11 18:57:44 +00:00
|
|
|
image = "redis:alpine"
|
|
|
|
keep_image = true
|
2019-04-15 19:08:40 +00:00
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
networks = ["nextcloud"]
|
2019-03-09 07:52:54 +00:00
|
|
|
|
2021-10-15 12:54:13 +00:00
|
|
|
resource = {
|
2019-03-09 07:52:54 +00:00
|
|
|
memory = 256
|
|
|
|
memory_swap = 256
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 12:54:13 +00:00
|
|
|
|