Some minor updates for Docker provider upgrade

This commit is contained in:
Nemo 2019-01-18 17:15:22 +05:30
parent 1b61a07c55
commit d1d3506e7b
8 changed files with 38 additions and 5 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
*.out
*.backup
secrets
k8s/

View File

@ -1,7 +1,7 @@
data "docker_registry_image" "traefik" {
# Critical and I like upgrading it
# for updating config for new features
name = "traefik:1.7-alpine"
name = "traefik:1.7"
}
data "docker_registry_image" "wikijs" {

View File

@ -87,6 +87,7 @@ resource "docker_container" "traefik" {
// https://github.com/terraform-providers/terraform-provider-docker/issues/10
networks = [
"${docker_network.traefik.id}",
"${data.docker_network.bridge.id}",
]
env = [
@ -94,3 +95,7 @@ resource "docker_container" "traefik" {
"CLOUDFLARE_API_KEY=${var.cloudflare_key}",
]
}
data "docker_network" "bridge" {
name = "bridge"
}

View File

@ -5,7 +5,7 @@ locals {
web {
"traefik.port" = "${lookup(var.web, "port", "80")}"
"traefik.frontend.rule" = "Host:${lookup(var.web, "host")}"
"traefik.frontend.rule" = "Host:${lookup(var.web, "host", "example.invalid")}"
"traefik.protocol" = "${lookup(var.web, "protocol", "http")}"
}

View File

@ -25,7 +25,7 @@ resource "docker_container" "container" {
// Only attach the traefik network if
// service is exposed to the web
networks = ["${concat(var.networks,split(",",lookup(var.web, "expose", "false") == "false" ? "" :"${data.docker_network.traefik.id}"))}"]
networks = ["${concat(var.networks,compact(split(",",lookup(var.web, "expose", "false") == "false" ? "" :"${data.docker_network.traefik.id}")))}"]
memory = "${local.resource["memory"]}"

View File

@ -6,7 +6,7 @@ module "opml" {
web {
expose = true
host = "opml.${var.domain}"
host = "${var.domain}"
}
env = [

View File

@ -7,7 +7,6 @@ module "redis" {
# ThisSucks
web {
expose = "false"
host = ""
}
resource {

28
pulse.tf Normal file
View File

@ -0,0 +1,28 @@
module "pulse-pshtt" {
name = "pulse-pshtt"
source = "modules/container"
image = "dhsncats/pshtt:0.5.2"
volumes = [
{
host_path = "/mnt/xwing/data/pulse"
container_path = "/home/pshtt"
},
]
web {
expose = false
host = ""
}
command = ["--debug", "--timeout=3", "--cache-third-parties=./cache", "domains.csv"]
must_run = "false"
restart = "no"
# nameserver = "192.168.1.1"
networks = ["bridge"]
resource = {
memory = 2048
}
}