nebula/docker/gitea.tf

79 lines
2.3 KiB
Terraform
Raw Normal View History

2017-12-26 16:44:21 +00:00
resource docker_container "gitea" {
name = "gitea"
image = "${docker_image.gitea.latest}"
labels {
2018-02-04 10:36:20 +00:00
"traefik.port" = 3000
"traefik.enable" = "true"
"traefik.frontend.rule" = "Host:git.captnemo.in"
"traefik.frontend.headers.STSSeconds" = "2592000"
"traefik.frontend.headers.browserXSSFilter" = "true"
"traefik.frontend.headers.contentTypeNosniff" = "true"
"traefik.frontend.headers.SSLTemporaryRedirect" = "true"
"traefik.frontend.headers.STSIncludeSubdomains" = "false"
"traefik.frontend.headers.customResponseHeaders" = "${var.xpoweredby}"
2017-12-26 16:44:21 +00:00
}
ports {
internal = 22
external = 2222
ip = "${var.ips["eth0"]}"
}
ports {
internal = 22
external = 2222
ip = "${var.ips["tun0"]}"
}
volumes {
volume_name = "${docker_volume.gitea_volume.name}"
container_path = "/data"
host_path = "${docker_volume.gitea_volume.mountpoint}"
}
2018-01-25 21:44:16 +00:00
# Logos
# TODO: Add svg
2018-01-25 20:53:53 +00:00
upload {
content = "${file("${path.module}/conf/gitea/public/img/gitea-lg.png")}"
file = "/data/gitea/public/img/gitea-lg.png"
}
upload {
content = "${file("${path.module}/conf/gitea/public/img/gitea-sm.png")}"
file = "/data/gitea/public/img/gitea-sm.png"
}
upload {
content = "${file("${path.module}/conf/gitea/public/img/gitea-sm.png")}"
file = "/data/gitea/public/img/favicon.png"
}
upload {
content = "${file("${path.module}/conf/humans.txt")}"
file = "/data/gitea/public/humans.txt"
}
2018-01-25 21:44:16 +00:00
# Extra Links in header
upload {
content = "${file("${path.module}/conf/gitea/extra_links.tmpl")}"
file = "/data/gitea/templates/custom/extra_links.tmpl"
}
# This is the main configuration file
2018-01-25 21:20:13 +00:00
upload {
content = "${data.template_file.gitea-config-file.rendered}"
file = "/data/gitea/conf/app.ini"
}
2017-12-26 16:44:21 +00:00
memory = 256
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}
2018-01-25 21:20:13 +00:00
data "template_file" "gitea-config-file" {
template = "${file("${path.module}/conf/gitea/conf.ini.tpl")}"
vars {
secret_key = "${var.gitea-secret-key}"
internal_token = "${var.gitea-internal-token}"
2018-02-03 07:36:06 +00:00
smtp_password = "${var.gitea-smtp-password}"
2018-01-25 21:20:13 +00:00
}
}