Moved nomad data files

This commit is contained in:
marc
2025-03-24 22:59:34 +01:00
parent 411bf5b0f2
commit e24078ec81
9 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
job "moimoin" {
region = "global"
datacenters = ["samfelag"]
type = "service"
group "moimoin" {
count = 1
restart {
attempts = 10
delay = "30s"
}
# VOLUMES
volume "mysql" {
type = "host"
read_only = false
source = "moimoin"
}
# NETWORK
network {
port "moimoin-front" {
to = 5000
}
port "moimoin-back" {
to = 3000
}
port "mysql" {
static = 33306
to = 3306
}
}
# TASKS
task "mysql" {
driver = "docker"
user = 1001
volume_mount {
volume = "mysql"
destination = "/var/lib/mysql"
read_only = false
}
env {
MYSQL_DATABASE = "xat-osr"
MYSQL_ROOT_PASSWORD = "estrell4galicia"
}
config {
image = "arm64v8/mysql:latest"
ports = ["mysql"]
}
resources {
cpu = 500
memory = 512
}
}
task "moimoin-back" {
driver = "docker"
config {
image = "marc.sastre.cat/moimoin-back:latest"
ports = ["moimoin-back"]
}
env {
MYSQL_HOST = "${attr.unique.network.ip-address}" # "100.91.225.117"
MYSQL_PORT = "33306"
MYSQL_USER = "root"
MYSQL_PASSWORD = "estrell4galicia"
MYSQL_NAME = "xat-osr"
CHAT_ADMIN_PSWD = "cervesaEspecial"
CLIENT_HOST = "marc.sastre.cat/moimoin"
}
resources {
cpu = 100
memory = 128
}
service {
name = "moimoin-back"
port = "moimoin-back"
check {
type = "tcp"
port = "moimoin-back"
interval = "30s"
timeout = "10s"
}
}
}
task "moimoin-front" {
driver = "docker"
config {
image = "marc.sastre.cat/moimoin-front:latest"
ports = ["moimoin-front"]
}
env {
CLIENT_PORT = "5000"
}
resources {
cpu = 100
memory = 128
}
service {
name = "moimoin-front"
port = "moimoin-front"
check {
type = "tcp"
port = "moimoin-front"
interval = "30s"
timeout = "10s"
}
}
}
}
}