-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtraefik.tf
56 lines (44 loc) · 1.07 KB
/
traefik.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
provider "docker" {
host = "unix:///var/run/docker.sock"
}
data "docker_registry_image" "traefik" {
name = "traefik:v1.7.16"
}
resource "docker_image" "traefik" {
name = "${data.docker_registry_image.traefik.name}"
pull_triggers = ["${data.docker_registry_image.traefik.sha256_digest}"]
}
resource "docker_container" "traefik" {
name = "traefik"
image = "${docker_image.traefik.latest}"
volumes {
host_path = "/var/run/docker.sock"
container_path = "/var/run/docker.sock"
read_only = true
}
volumes {
host_path = "${var.mount_point}/config/acme"
container_path = "/acme"
}
upload {
content = "${file("${path.module}/conf/traefik.toml")}"
file = "/etc/traefik/traefik.toml"
}
ports {
external = 80
internal = 80
}
ports {
external = 443
internal = 443
}
ports {
external = 8080
internal = 8080
}
env = ["DO_AUTH_TOKEN=${var.do_token}"]
memory = 256
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}