-
Notifications
You must be signed in to change notification settings - Fork 1
/
do_instances.tf
60 lines (60 loc) · 1.48 KB
/
do_instances.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
57
58
59
60
resource "digitalocean_droplet" "redis" {
image = "coreos-stable"
region = "ams3"
size = "512mb"
name = "redis"
ssh_keys = ["${digitalocean_ssh_key.default.fingerprint}"]
connection {
user = "core"
}
provisioner "remote-exec" {
inline = [
"docker run -dp 6379:6379 redis",
]
}
}
resource "digitalocean_droplet" "voting" {
image = "coreos-stable"
region = "ams3"
size = "512mb"
ssh_keys = ["${digitalocean_ssh_key.default.fingerprint}"]
name = "voting"
connection {
user = "core"
}
provisioner "remote-exec" {
inline = [
"docker run -dp 80:80 -e REDIS_HOST=${digitalocean_droplet.redis.ipv4_address} ditmc/voting",
]
}
}
resource "digitalocean_droplet" "worker" {
image = "coreos-stable"
region = "ams3"
size = "512mb"
ssh_keys = ["${digitalocean_ssh_key.default.fingerprint}"]
name = "redis"
connection {
user = "core"
}
provisioner "remote-exec" {
inline = [
"docker run -dp 80:80 -e REDIS_HOST=${digitalocean_droplet.redis.ipv4_address} -e DB_HOST=${aws_eip.db_ip.public_ip} ditmc/worker"
]
}
}
resource "digitalocean_droplet" "result" {
image = "coreos-stable"
region = "ams3"
size = "512mb"
ssh_keys = ["${digitalocean_ssh_key.default.fingerprint}"]
name = "result"
connection {
user = "core"
}
provisioner "remote-exec" {
inline = [
"docker run -dp 80:80 -e DB_HOST=${aws_eip.db_ip.public_ip} ditmc/result"
]
}
}