switch supysonic to fcgi
This commit is contained in:
parent
e5ea720753
commit
af02cacb12
@ -13,38 +13,84 @@ job "supysonic" {
|
||||
group "supysonic"{
|
||||
network {
|
||||
mode = "host"
|
||||
port "http" {
|
||||
port "fcgi" {
|
||||
to = 5000
|
||||
}
|
||||
port "http" {
|
||||
to=80
|
||||
}
|
||||
}
|
||||
vault{
|
||||
policies= ["access-tables"]
|
||||
|
||||
}
|
||||
task "server" {
|
||||
service {
|
||||
name = "supysonic"
|
||||
port = "http"
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`)",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
task "frontend" {
|
||||
driver = "docker"
|
||||
service {
|
||||
name = "supysonic"
|
||||
port = "http"
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`)",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
|
||||
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
|
||||
|
||||
|
||||
config {
|
||||
image= "nginx:alpine"
|
||||
ports= [
|
||||
"http"
|
||||
]
|
||||
volumes = [
|
||||
"etc/nginx/nginx.conf:/etc/nginx/nginx.conf",
|
||||
]
|
||||
}
|
||||
template {
|
||||
data = <<EOH
|
||||
worker_processes auto;
|
||||
pid /var/run/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
try_files $uri @flaskr;
|
||||
}
|
||||
location @flaskr {
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_NAME "";
|
||||
fastcgi_param PATH_INFO $fastcgi_script_name;
|
||||
fastcgi_pass {{env "NOMAD_ADDR_fcgi"}};
|
||||
}
|
||||
}
|
||||
}
|
||||
EOH
|
||||
destination = "etc/nginx/nginx.conf"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
task "server" {
|
||||
driver = "docker"
|
||||
config {
|
||||
image = "ogarcia/supysonic:full-sql"
|
||||
ports = ["http"]
|
||||
ports = ["fcgi"]
|
||||
force_pull= true
|
||||
volumes = [
|
||||
"/mnt/diskstation/music:/mnt/diskstation/music"
|
||||
]
|
||||
|
||||
}
|
||||
env {
|
||||
SUPYSONIC_RUN_MODE= "standalone"
|
||||
SUPYSONIC_RUN_MODE= "fcgi-port"
|
||||
SUPYSONIC_DAEMON_ENABLED = "true"
|
||||
SUPYSONIC_WEBAPP_LOG_LEVEL = "WARNING"
|
||||
SUPYSONIC_DAEMON_LOG_LEVEL = "INFO"
|
||||
|
Loading…
Reference in New Issue
Block a user