Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimc-7121 add packit to proxy #83

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,13 @@ services:
volumes:
- token_key_volume:/etc/montagu/api/token_key
- ${PWD}/montagu_emails:/tmp/montagu_emails
orderly_web_web:
image: ${ORG}/orderly-web:master
networks:
- proxy
depends_on:
- api
volumes:
- orderly_volume:/orderly
db:
image: ${ORG}/montagu-db:master
ports:
- "5432:5432"
command: /etc/montagu/postgresql.test.conf
networks:
- proxy
orderly:
image: ${ORG}/orderly.server:master
volumes:
- orderly_volume:/orderly
command: --port 8321 --go-signal /orderly_go /orderly
networks:
- proxy
contrib:
image: ${ORG}/montagu-contrib-portal:master
networks:
Expand All @@ -62,7 +47,6 @@ services:
- static_volume:/www
- static_logs:/var/log/caddy
volumes:
orderly_volume:
template_volume:
guidance_volume:
static_logs:
Expand Down
21 changes: 19 additions & 2 deletions nginx.montagu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,35 @@ server {

# resolving /reports/ dynamically because the orderly web container may not be up when the proxy starts
# for an explanation of this config see: https://tenzer.dk/nginx-with-dynamic-upstreams/
set $orderly_web http://orderly_web_web:8888;
set $orderly_web http://orderly-web-web:8888;
location /reports/ {
resolver 127.0.0.11 valid=30s;
rewrite ^/reports/(.*) /$1 break;
proxy_pass $orderly_web;
proxy_redirect http://orderly_web_web:8888/ /reports/;
proxy_redirect http://orderly-web-web:8888/ /reports/;

location "~/reports/(?<name>[^/]+)/(?<version>\d{8}-\d{6}-[0-9a-f]{8})" {
return 301 /reports/report/$name/$version;
}
}

# resolving /packit/ dynamically for the same reason
set $packit http://orderly-web-packit;
location /packit/ {
resolver 127.0.0.11 valid=30s;
rewrite ^/packit/(.*) /$1 break;
proxy_pass $packit;
proxy_redirect http://orderly-web-packit/ /packit/;
}

set $packit_api http://orderly-web-packit-api:8080;
location /packit/api/ {
resolver 127.0.0.11 valid=30s;
rewrite ^/packit/api/(.*) /$1 break;
proxy_pass $packit_api;
proxy_redirect http://orderly-web-packit-api:8080/ /packit/api/;
}

# Ideally these github bots would be on a separate proxy server
# see https://mrc-ide.myjetbrains.com/youtrack/issue/mrc-1280
# Resolving dynamically for the same reason as above
Expand Down
Loading