Skip to content
Snippets Groups Projects
Commit 2da08ed7 authored by uıןǝnbsɐW ןǝɐʞɔıW's avatar uıןǝnbsɐW ןǝɐʞɔıW
Browse files

Update project.nomad

parent e8a35e29
Branches
No related tags found
No related merge requests found
Pipeline #1449 canceled
......@@ -11,14 +11,17 @@ job "php-worker-service" {
count = 1
network {
mode = "host"
port "php-fpm" {
to = 9000
static = 9000
}
}
} # end of network decl. for php-fpm
task "php-fpm" {
driver = "docker"
config {
......@@ -31,18 +34,22 @@ job "php-worker-service" {
port = "php-fpm"
provider = "consul"
}
}
} # end of task decl. for php-fpm
}
group "whoami" {
count = 1
network {
mode = "host"
port "webserver" {
to = 80
}
}
} # end of network decl. for php-fpm
task "server" {
......@@ -56,7 +63,7 @@ job "php-worker-service" {
config {
image = "nginx"
ports = ["webserver"]
volumes = [ "local/datas/index.html:/usr/share/nginx/html/index.html" ]
volumes = [ "local/datas/index.html:/usr/share/nginx/html/index.html", "local/default.conf:/etc/nginx/conf.d/default.conf" ]
}
resources {
......@@ -80,10 +87,55 @@ job "php-worker-service" {
"traefik.http.services.whoami.loadbalancer.sticky",
"traefik.http.routers.whoami.rule=Host(`whoami.priv.lifl.fr`)",
]
} # end of service decl. for nginx
template {
change_mode = "restart"
destination = "local/nginx.conf"
data = <<EOH
server {
listen 80;
server_name localhost;
charset utf-8;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
root html;
{{ range service "php-fpm" }}
fastcgi_pass {{ .Address }}:{{ .Port }};
{{ end }}
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
EOH
} # end of template decl. for nginx
} # end of task decl. for nginx
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment