-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonolith.nomad
More file actions
86 lines (77 loc) · 1.96 KB
/
monolith.nomad
File metadata and controls
86 lines (77 loc) · 1.96 KB
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
job "revuelta-monolith" {
datacenters = ["dc1"]
# GRUPO 1: Base de Datos (Igual que siempre)
group "database" {
count = 1
network {
port "db" { static = 3306 }
}
task "mariadb" {
driver = "docker"
config {
image = "mariadb:12.1.2"
ports = ["db"]
args = ["--bind-address=0.0.0.0"]
}
env {
MARIADB_ROOT_PASSWORD = "password"
MARIADB_DATABASE = "revuelta_db"
MARIADB_USER = "nomad"
MARIADB_PASSWORD = "password"
}
service {
name = "mariadb"
port = "db"
address_mode = "host"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
resources {
cpu = 500
memory = 512
}
}
}
# GRUPO 2: API Quarkus (Modo Solitario)
group "backend" {
count = 1 # <--- Solo UNO. El punto único de fallo.
network {
# Puerto ESTÁTICO 8080.
# Aquí no hay balanceador, conectamos directo a la aplicación.
port "http" { static = 8080 }
}
task "api" {
driver = "docker"
config {
image = "quarkus/nomad-quarkus-jvm:0.0.1"
ports = ["http"]
}
env {
# Conexión a la DB
QUARKUS_DATASOURCE_JDBC_URL = "jdbc:mariadb://${attr.unique.network.ip-address}:3306/revuelta_db?useSSL=false"
QUARKUS_DATASOURCE_USERNAME = "nomad"
QUARKUS_DATASOURCE_PASSWORD = "password"
QUARKUS_HTTP_HOST = "0.0.0.0"
}
# Registramos el servicio solo para salud, pero no hay Fabio escuchando etiquetas
service {
name = "api-monolith"
port = "http"
address_mode = "host"
check {
type = "http"
path = "/api/q/health"
interval = "10s"
timeout = "2s"
}
}
resources {
cpu = 200
memory = 256
}
}
}
}