-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOSTicket-Nomad.tf
119 lines (103 loc) · 2.84 KB
/
OSTicket-Nomad.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
job "osticket" {
datacenters = ["mydatacenter"]
group "osticket" {
network {
mode = "host"
port "tcp" {
static = 3306
}
port "http" {
static = 8080
}
}
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "5m"
progress_deadline = "10m"
auto_revert = true
auto_promote = true
canary = 1
}
volume "osticket_db" {
type = "host"
read_only = false
source = "osticket_db"
}
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
service {
name = "osticket-db"
port = "tcp"
tags = [
"database"
]
check {
name = "DB Health"
port = "tcp"
type = "tcp"
interval = "30s"
timeout = "4s"
}
}
service {
name = "osticket-frontend"
port = "http"
tags = [
"frontend"
]
check {
name = "HTTP Health"
path = "/"
type = "http"
protocol = "http"
interval = "10s"
timeout = "2s"
}
}
task "osticket-db" {
driver = "docker"
config {
image = "mariadb:latest"
ports = ["tcp"]
network_mode = "host"
force_pull = false
}
volume_mount {
volume = "osticket_db"
destination = "/var/lib/mysql" #<-- in the container
read_only = false
}
env {
MYSQL_ROOT_PASSWORD = "secret"
MYSQL_USER = "osticket"
MYSQL_PASSWORD = "secret"
MYSQL_DATABASE = "osticket"
CONTAINER_NAME = "127.0.0.1"
}
}
task "osticket-frontend" {
driver = "docker"
config {
image = "my.gitlab.com:12345/server_management/osticket-docker:latest"
ports = ["http"]
network_mode = "host"
force_pull = false
auth {
username = "mygitlabuser"
password = "asecretpassword"
}
}
env {
MYSQL_USER = "osticket"
MYSQL_HOST = "127.0.0.1"
MYSQL_PASSWORD = "secret"
MYSQL_DATABASE = "osticket"
}
}
}
}