Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hello-world-nomad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uıןǝnbsɐW ןǝɐʞɔıW
hello-world-nomad
Commits
2da08ed7
Commit
2da08ed7
authored
2 years ago
by
uıןǝnbsɐW ןǝɐʞɔıW
Browse files
Options
Downloads
Patches
Plain Diff
Update project.nomad
parent
e8a35e29
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1449
canceled
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
project.nomad
+58
-6
58 additions, 6 deletions
project.nomad
with
58 additions
and
6 deletions
project.nomad
+
58
−
6
View file @
2da08ed7
...
...
@@ -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
/
50
x
.
html
;
location
=
/
50
x
.
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
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment