89 lines
2.3 KiB
HCL
89 lines
2.3 KiB
HCL
job "wordpress" {
|
|
datacenters = ["alo"]
|
|
|
|
meta {
|
|
uuid = uuidv4()
|
|
}
|
|
|
|
group "web" {
|
|
network {
|
|
port "http" {
|
|
to = 80
|
|
}
|
|
}
|
|
|
|
task "server" {
|
|
driver = "docker"
|
|
user = "237"
|
|
|
|
config {
|
|
image = "gitea.v.paler.net/ppetru/wordpress"
|
|
ports = ["http"]
|
|
volumes = [
|
|
"/data/sync/wordpress:/var/www/html",
|
|
"local/php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini",
|
|
]
|
|
}
|
|
|
|
env {
|
|
WORDPRESS_DB_HOST = "mysql.service.consul"
|
|
WORDPRESS_DB_USER = "wordpress"
|
|
WORDPRESS_DB_PASSWORD = "Cayuquai3Eesh6gohph0"
|
|
WORDPRESS_DB_NAME = "wordpress"
|
|
#WORDPRESS_DEBUG = "1"
|
|
WORDPRESS_CONFIG_EXTRA =<<EOH
|
|
define('MULTISITE', true);
|
|
define('SUBDOMAIN_INSTALL', true);
|
|
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']);
|
|
define('PATH_CURRENT_SITE', '/');
|
|
define('SITE_ID_CURRENT_SITE', 1);
|
|
define('BLOG_ID_CURRENT_SITE', 4);
|
|
//define('DOMAIN_CURRENT_SITE', 'wordpress.paler.net');
|
|
//define('WP_HOME', 'https://wordpress.paler.net');
|
|
//define('WP_SITEURL', 'https://wordpress.paler.net');
|
|
define('WP_REDIS_HOST', 'redis.service.consul');
|
|
EOH
|
|
}
|
|
|
|
template {
|
|
destination = "local/php-custom.ini"
|
|
data = <<EOH
|
|
upload_max_filesize = 100M
|
|
post_max_size = 100M
|
|
max_execution_time = 600
|
|
EOH
|
|
}
|
|
|
|
resources {
|
|
cpu = 6000
|
|
memory = 1024
|
|
}
|
|
|
|
service {
|
|
name = "wordpress"
|
|
port = "http"
|
|
|
|
tags = [
|
|
"traefik.enable=true",
|
|
"traefik.http.routers.wordpress.entryPoints=web4proxy",
|
|
"traefik.http.routers.wordpress.rule=Host(`wordpress.paler.net`) || Host(`ines.paler.net`) || Host(`coachingfor.me`) || Host(`coachingfor.work`) || Host(`petru.ines.paler.net`) || Host(`liam.paler.net`) || Host(`tomas.paler.net`) || Host(`musictogethersilvercoast.pt`)",
|
|
"traefik.http.routers.wordpress.middlewares=compress@file",
|
|
]
|
|
|
|
check {
|
|
type = "http"
|
|
port = "http"
|
|
path = "/wp-admin/install.php"
|
|
interval = "5s"
|
|
timeout = "2s"
|
|
|
|
check_restart {
|
|
limit = 3
|
|
grace = "60s"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|