nebula/wiki.tf

70 lines
1.2 KiB
Terraform
Raw Permalink Normal View History

2021-01-07 18:53:14 +00:00
data "template_file" "wiki-config" {
2021-03-20 07:39:19 +00:00
template = file("docker/conf/wiki.tpl")
vars = {
DB_PASSWORD = data.pass_password.wiki-db-password.password
2021-01-07 18:53:14 +00:00
}
}
resource "local_file" "wiki-config" {
2021-03-20 07:39:19 +00:00
content = data.template_file.wiki-config.rendered
2021-01-07 18:53:14 +00:00
filename = "docker/conf/wiki.yml"
}
module "wiki-container" {
name = "wiki2"
2021-03-20 07:39:19 +00:00
source = "./modules/container"
2021-01-07 18:53:14 +00:00
image = "requarks/wiki:2"
2021-03-20 07:39:19 +00:00
resource = {
2021-01-07 18:53:14 +00:00
memory = 1024
memory_swap = 1024
}
2021-03-20 07:39:19 +00:00
web = {
2021-01-07 18:53:14 +00:00
expose = true
port = 3000
host = "wiki.bb8.fun"
}
networks_advanced = [
{
name = "traefik"
2021-03-20 07:39:19 +00:00
},
{
2021-01-07 18:53:14 +00:00
name = "postgres"
2021-03-20 07:39:19 +00:00
},
{
2021-01-07 18:53:14 +00:00
name = "external"
2021-03-20 07:39:19 +00:00
},
]
2021-01-07 18:53:14 +00:00
uploads = [
{
2021-03-20 07:39:19 +00:00
content = file("docker/conf/wiki.yml")
2021-01-07 18:53:14 +00:00
file = "/wiki/config.yml"
2021-03-20 07:39:19 +00:00
},
2021-01-07 18:53:14 +00:00
]
2021-03-20 07:39:19 +00:00
volumes = [
{
host_path = "/mnt/xwing/data/wiki/data"
container_path = "/data"
2021-01-07 18:53:14 +00:00
},
{
host_path = "/mnt/xwing/data/wiki/databackup"
container_path = "/old/data"
},
{
host_path = "/mnt/xwing/data/wiki/repo"
container_path = "/old/repo"
2021-03-20 07:39:19 +00:00
},
]
2021-01-07 18:53:14 +00:00
}
module "wiki-db" {
2021-03-20 07:39:19 +00:00
source = "./modules/postgres"
2021-01-07 18:53:14 +00:00
name = "wikijs"
2021-03-20 07:39:19 +00:00
password = data.pass_password.wiki-db-password.password
2021-01-07 18:53:14 +00:00
}
2021-03-20 07:39:19 +00:00