-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#50] Implement initial nginx settings
- Loading branch information
Showing
9 changed files
with
216 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#SHARED_ROOT=/host_mnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
version: "3.9" | ||
|
||
services: | ||
nginx: | ||
image: nginx:latest | ||
ports: | ||
- "1235:80" | ||
container_name: "nginx_main" | ||
restart: always | ||
depends_on: | ||
- s-pipes-engine | ||
- s-pipes-editor-rest | ||
- db-server | ||
- s-pipes-editor-ui | ||
environment: | ||
NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx | ||
APP_ORIGIN: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}" | ||
SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" | ||
volumes: | ||
- ./nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template:ro | ||
- ./nginx/error.html:/usr/share/nginx/html/error.html:ro | ||
|
||
s-pipes-editor-ui: | ||
image: "ghcr.io/kbss-cvut/s-pipes-editor-ui/s-pipes-editor-ui:latest" | ||
expose: | ||
- "80" | ||
depends_on: | ||
- s-pipes-editor-rest | ||
environment: | ||
SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" | ||
|
||
s-pipes-editor-rest: | ||
# <<: *s-pipes-editor-rest-dev-port | ||
image: "ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor:latest" | ||
expose: | ||
- "18115" | ||
depends_on: | ||
- s-pipes-engine | ||
- db-server | ||
environment: | ||
SCRIPTPATHS: "${SCRIPTPATHS:-${PWD}/../../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../../s-pipes/doc/examples}}" | ||
SCRIPTRULES: "${SCRIPTRULES:-${PWD}/../../s-pipes-editor/src/main/resources/rules}" | ||
ENGINEURL: "${SPIPES_ENGINE:-http://s-pipes-engine:8080/s-pipes}/" | ||
RDF4J_REPOSITORYURL: "${RDF4J_SERVER_URL:-http://db-server:7200}/repositories" | ||
RDF4J_REPOSITORYNAME: "${RDF4J_REPOSITORYNAME:-s-pipes-hello-world}" | ||
RDF4J_PCONFIGURL: "${RDF4J_PCONFIGURL:-./s-pipes-engine/config.ttl}" | ||
volumes: | ||
- /tmp:/tmp | ||
- ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} | ||
# - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ | ||
|
||
s-pipes-engine: | ||
image: "ghcr.io/kbss-cvut/s-pipes/s-pipes-engine:latest" | ||
# container_name: s-pipes-engine | ||
expose: | ||
- "8080" | ||
depends_on: | ||
- db-server | ||
environment: | ||
CONTEXTS_SCRIPTPATHS: "${SCRIPTPATHS:-${PWD}/../../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../../s-pipes/doc/examples}}" | ||
volumes: | ||
- /tmp:/tmp | ||
- ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} | ||
# - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ | ||
|
||
db-server: | ||
build: | ||
context: ./db-server | ||
ports: | ||
- "7200:7200" | ||
volumes: | ||
- ./db-server/init-config:/repo-config:ro | ||
- db-server:/opt/graphdb/home | ||
|
||
volumes: | ||
data: | ||
logs: | ||
db-server: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- Record manager Nginx reverse proxy--> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title><!--# echo var="status" default="" --> | Record manager</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<!--# if expr="$status = 502" --> | ||
<meta http-equiv="refresh" content="2" /> | ||
<!--# endif --> | ||
</head> | ||
<style type="text/css"> | ||
body { | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
color: #fff; | ||
height: 100vh; | ||
margin: 0; | ||
background: #263238 linear-gradient(5deg, #057fa5 0%, #263238 100%); | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
</style> | ||
<body> | ||
<!--# if expr="$status = 502" --> | ||
<h1>The application is currently being updated</h1> | ||
<p>You will be redirected to the new version in a few seconds.</p> | ||
<p>If you see this message for more than a minute, something has gone wrong.</p> | ||
<!--# else --> | ||
<h1>Sorry, something went wrong.</h1> | ||
<p><!--# echo var="status" default="" --></p> | ||
<!--# endif --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
worker_processes 1; | ||
|
||
events | ||
{ | ||
worker_connections 1024; | ||
} | ||
|
||
http | ||
{ | ||
|
||
client_max_body_size 100M; | ||
|
||
include mime.types; | ||
default_type application/octet-stream; | ||
|
||
map $status $status_text | ||
{ | ||
400 'Bad Request'; | ||
401 'Unauthorized'; | ||
403 'Forbidden'; | ||
404 'Not Found'; | ||
405 'Method Not Allowed'; | ||
406 'Not Acceptable'; | ||
413 'Payload Too Large'; | ||
414 'URI Too Long'; | ||
431 'Request Header Fields Too Large'; | ||
500 'Internal Server Error'; | ||
501 'Not Implemented'; | ||
502 'Bad Gateway'; | ||
503 'Service Unavailable'; | ||
504 'Gateway Timeout'; | ||
} | ||
|
||
server | ||
{ | ||
listen 80; | ||
server_name localhost; | ||
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | ||
415 416 417 418 421 422 423 424 426 428 429 431 451 500 501 502 503 | ||
504 505 506 507 508 510 511 /error.html; | ||
|
||
location = /error.html { | ||
|
||
ssi on; | ||
internal; | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
location / { | ||
proxy_pass http://s-pipes-editor-ui; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /rest { | ||
return 302 ${APP_ORIGIN}/rest/; | ||
} | ||
|
||
location /rest/ { | ||
proxy_pass ${SERVICE_URL}/og_spipes/rest/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location = /services/db-server | ||
{ | ||
return 302 ${APP_ORIGIN}/services/db-server/; | ||
} | ||
|
||
location = /services/db-server/ | ||
{ | ||
proxy_pass http://db-server:7200/; | ||
} | ||
|
||
location = /services/s-pipes { | ||
return 302 ${APP_ORIGIN}/services/s-pipes/; | ||
} | ||
|
||
location = /services/s-pipes/ | ||
{ | ||
proxy_pass http://s-pipes-engine:8080/; | ||
} | ||
|
||
location = /health-check | ||
{ | ||
return 200; | ||
access_log off; | ||
} | ||
|
||
} | ||
} |