2022-05-12 09:36:51 +00:00
|
|
|
job "www" {
|
|
|
|
datacenters = ["hetzner"]
|
2022-12-10 16:10:32 +00:00
|
|
|
priority = 90
|
2022-10-29 08:40:01 +00:00
|
|
|
type = "service"
|
2022-05-12 09:36:51 +00:00
|
|
|
group "www" {
|
|
|
|
network {
|
|
|
|
mode = "host"
|
|
|
|
port "http" {
|
2022-10-29 08:40:01 +00:00
|
|
|
to = 80
|
2022-05-12 09:36:51 +00:00
|
|
|
host_network = "private"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
service {
|
2022-10-29 08:40:01 +00:00
|
|
|
name = "www"
|
|
|
|
tags = [
|
|
|
|
"homer.enable=true",
|
|
|
|
"homer.name=Website",
|
|
|
|
"homer.service=Application",
|
|
|
|
"homer.icon=fas fa-blog",
|
|
|
|
"homer.target=_blank",
|
2023-11-05 18:08:17 +00:00
|
|
|
"homer.url=https://www.ducamps.eu",
|
2022-05-23 19:44:34 +00:00
|
|
|
|
2022-10-29 08:40:01 +00:00
|
|
|
"traefik.enable=true",
|
2023-11-05 18:08:17 +00:00
|
|
|
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.eu`)",
|
|
|
|
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.eu",
|
2022-10-29 08:40:01 +00:00
|
|
|
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
|
2023-10-14 07:14:26 +00:00
|
|
|
"traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure",
|
2022-10-10 19:22:57 +00:00
|
|
|
|
2023-11-05 18:08:17 +00:00
|
|
|
"traefik.http.routers.default.rule=Host(`ducamps.eu`)",
|
2023-10-14 07:14:26 +00:00
|
|
|
"traefik.http.routers.default.entrypoints=web,websecure",
|
2023-11-05 18:08:17 +00:00
|
|
|
"traefik.http.routers.default.tls.domains[0].sans=ducamps.eu",
|
2022-10-29 08:40:01 +00:00
|
|
|
"traefik.http.routers.default.tls.certresolver=myresolver",
|
|
|
|
]
|
|
|
|
port = "http"
|
2022-05-12 09:36:51 +00:00
|
|
|
}
|
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2024-03-17 17:58:24 +00:00
|
|
|
image = "docker.service.consul:5000/library/nginx"
|
2022-05-12 09:36:51 +00:00
|
|
|
ports = [
|
|
|
|
"http"
|
|
|
|
]
|
2022-10-29 08:40:01 +00:00
|
|
|
volumes = [
|
2022-05-12 09:36:51 +00:00
|
|
|
"local/nginx.conf:/etc/nginx/nginx.conf",
|
2024-01-30 19:53:30 +00:00
|
|
|
"/srv/http/:/usr/share/nginx/html/",
|
|
|
|
"/mnt/diskstation/nomad/archiso:/usr/share/nginx/archiso"
|
2022-05-12 09:36:51 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
}
|
2022-10-29 08:40:01 +00:00
|
|
|
template {
|
|
|
|
data = <<EOH
|
2022-05-12 09:36:51 +00:00
|
|
|
worker_processes auto;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
access_log /dev/stdout;
|
|
|
|
error_log /dev/stderr warn;
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
error_page 404 /404/404.html;
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location / {
|
|
|
|
rewrite ^/.well-known/carddav /radicale/$remote_user/carddav/ redirect;
|
|
|
|
rewrite ^/.well-known/caldav /radicale/$remote_user/caldav/ redirect;
|
|
|
|
index index.html index.htm ;
|
|
|
|
default_type text/html;
|
|
|
|
}
|
|
|
|
location =/ {
|
2024-01-24 17:43:26 +00:00
|
|
|
rewrite ^ /welcome redirect;
|
|
|
|
#return 301 https://$host/welcome
|
2022-05-12 09:36:51 +00:00
|
|
|
}
|
2024-01-30 19:53:30 +00:00
|
|
|
location /archiso {
|
|
|
|
alias /usr/share/nginx/archiso/;
|
|
|
|
|
|
|
|
}
|
2022-05-12 09:36:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
EOH
|
2022-10-29 08:40:01 +00:00
|
|
|
destination = "local/nginx.conf"
|
2022-05-12 09:36:51 +00:00
|
|
|
}
|
|
|
|
resources {
|
|
|
|
memory = 50
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|