-
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.
Merge pull request #221 from kit-data-manager/reverse-proxy
Reverse proxy
- Loading branch information
Showing
12 changed files
with
164 additions
and
17 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
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 |
---|---|---|
@@ -1,31 +1,35 @@ | ||
services: | ||
proxy: | ||
container_name: evokstest_proxy | ||
restart: "no" | ||
|
||
postgres: | ||
container_name: evokstest_postgres | ||
restart: no | ||
restart: "no" | ||
|
||
web: | ||
container_name: evokstest_testrunner | ||
command: > | ||
entrypoint: > | ||
sh -c "set -e && | ||
cd ./evoks && | ||
python manage.py migrate && | ||
coverage run manage.py test -v 3 tests/model/ tests/migration/ tests/skosmos/ tests/fuseki/ tests/views/ tests/evoks && | ||
coverage report && | ||
coverage xml" | ||
restart: no | ||
restart: "no" | ||
|
||
fuseki-dev: | ||
container_name: evokstest_fuseki-dev | ||
restart: no | ||
restart: "no" | ||
|
||
fuseki-live: | ||
container_name: evokstest_fuseki-live | ||
restart: no | ||
restart: "no" | ||
|
||
skosmos-dev: | ||
container_name: evokstest_skosmos-dev | ||
restart: no | ||
restart: "no" | ||
|
||
skosmos-live: | ||
container_name: evokstest_skosmos-live | ||
restart: no | ||
restart: "no" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM nginx:1.13-alpine | ||
COPY proxy-template.conf /etc/nginx/conf.d/default.conf.template | ||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
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,7 @@ | ||
#!/bin/sh | ||
|
||
# Substitute environment variables in the Nginx template | ||
envsubst '\$EVOKS_URL' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf | ||
|
||
# Start Nginx | ||
nginx -g 'daemon off;' |
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,93 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
absolute_redirect off; | ||
|
||
location ${EVOKS_URL}/ { | ||
proxy_pass http://web:8000/; | ||
proxy_redirect http://web:8000/ http://$host/; | ||
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; | ||
|
||
# Increase timeouts because evoks is sometimes slow | ||
proxy_connect_timeout 10s; | ||
proxy_send_timeout 10s; | ||
proxy_read_timeout 10s; | ||
|
||
# # increase buffers / disable buffers | ||
# proxy_buffering off; | ||
# proxy_buffer_size 128k; | ||
# proxy_buffers 4 256k; | ||
# proxy_busy_buffers_size 256k; | ||
# proxy_max_temp_file_size 0; | ||
|
||
# Handle large request bodies | ||
client_max_body_size 50M; | ||
|
||
# static files of evoks | ||
location ${EVOKS_URL}/static/ { | ||
include /etc/nginx/mime.types; | ||
alias /app/evoks/static/; | ||
} | ||
|
||
} | ||
|
||
|
||
location /skosmos-dev/ { | ||
proxy_pass http://skosmos-dev:80/; | ||
proxy_redirect http://skosmos-dev:80/ http://$host/skosmos-dev/; | ||
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; | ||
|
||
# Increase timeouts because skosmos is sometimes slow | ||
proxy_connect_timeout 10s; | ||
proxy_send_timeout 10s; | ||
proxy_read_timeout 10s; | ||
# Handle large request bodies | ||
client_max_body_size 50M; | ||
|
||
# static files of skosmos-dev | ||
location /skosmos-dev/static/ { | ||
include /etc/nginx/mime.types; | ||
alias /app/skosmos-dev/static/; | ||
} | ||
|
||
} | ||
|
||
|
||
location /skosmos-live/ { | ||
proxy_pass http://skosmos-live:80/; | ||
proxy_redirect http://skosmos-live:80/ http://$host/skosmos-live/; | ||
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; | ||
|
||
# Increase timeouts because skosmos is sometimes slow | ||
proxy_connect_timeout 10s; | ||
proxy_send_timeout 10s; | ||
proxy_read_timeout 10s; | ||
# Handle large request bodies | ||
client_max_body_size 50M; | ||
|
||
# static files of skosmos-live | ||
location /skosmos-live/static/ { | ||
include /etc/nginx/mime.types; | ||
alias /app/skosmos-live/static/; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} |
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 |
---|---|---|
|
@@ -13,3 +13,5 @@ langcodes | |
coverage | ||
requests | ||
unidecode | ||
gunicorn | ||
environs==7.3.1 |
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