Skip to content

Commit

Permalink
Fixes for perseus web - to override port
Browse files Browse the repository at this point in the history
Added atlasdb to solr vocab testing
  • Loading branch information
alondhe committed Sep 11, 2023
1 parent ca79fa0 commit e9b1ddd
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/solr-vocab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
printf "[dn]\nCN=127.0.0.1\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:127.0.0.1\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
- name: Build traefik container
run: docker-compose --env-file .env up -d
- name: Build atlasdb profile
run: docker-compose --env-file .env --profile atlasdb up -d
- name: Build empty SOLR instance
run: docker-compose --env-file .env --profile solr-vocab-no-import up -d
- name: Build webapi profile with SOLR_VOCAB enabled
Expand Down
60 changes: 29 additions & 31 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ services:
environment:
SPRING_PROFILES_ACTIVE: docker
SPRING_DATASOURCE_URL: jdbc:postgresql://perseus-shareddb:5432/shared
depends_on:
- perseus-shareddb
#depends_on:
# - perseus-shareddb


perseus-web:
Expand All @@ -435,6 +435,8 @@ services:
platform: linux/amd64
container_name: perseus-web
restart: always
volumes:
- ./perseus/web/server.docker.conf:/etc/nginx/server.docker.conf
labels:
- "traefik.enable=true"

Expand All @@ -444,11 +446,7 @@ services:
image: perseushub/user:latest
platform: linux/amd64
container_name: perseus-user
#secrets:
# - PERSEUS_TOKEN_SECRET_KEY
# - PERSEUS_EMAIL_SECRET_KEY
environment:
DB_HOST: perseus-shareddb
SMTP_SERVER: ${PERSEUS_SMTP_SERVER}
SMTP_PORT: ${PERSEUS_SMTP_PORT}
SMTP_EMAIL: ${PERSEUS_SMTP_EMAIL}
Expand All @@ -461,8 +459,8 @@ services:
- ./perseus/user/config.py:/app/config.py
ports:
- "5001:5001"
depends_on:
- perseus-shareddb
#depends_on:
# - perseus-shareddb

perseus-backend:
profiles: [ "perseus-backend", "perseus" ]
Expand All @@ -475,9 +473,9 @@ services:
- ./perseus/backend/config.py:/app/config.py
ports:
- "5000:5000"
depends_on:
- perseus-shareddb
- perseus-files-manager
#depends_on:
# - perseus-shareddb
# - perseus-files-manager

perseus-frontend:
profiles: [ "perseus-frontend", "perseus" ]
Expand Down Expand Up @@ -512,10 +510,10 @@ services:
- "9000:9000"
environment:
- ASPNETCORE_ENVIRONMENT=Docker
depends_on:
- perseus-shareddb
- perseus-files-manager
- perseus-vocabularydb
#depends_on:
# - perseus-shareddb
# - perseus-files-manager
# - perseus-vocabularydb

perseus-solr:
profiles: [ "perseus-solr", "perseus" ]
Expand All @@ -526,8 +524,8 @@ services:
- "8983:8983"
volumes:
- perseus-solr:/var/solr
depends_on:
- perseus-vocabularydb
#depends_on:
# - perseus-vocabularydb

perseus-athena:
profiles: [ "perseus-athena", "perseus" ]
Expand All @@ -540,8 +538,8 @@ services:
- ./perseus/athena/config.py:/app/config.py
ports:
- "5002:5002"
depends_on:
- perseus-solr
#depends_on:
# - perseus-solr

perseus-usagi:
profiles: [ "perseus-usagi", "perseus" ]
Expand All @@ -555,9 +553,9 @@ services:
- ./perseus/usagi/config.py:/app/config.py
ports:
- "5003:5003"
depends_on:
- perseus-shareddb
- perseus-solr
#depends_on:
# - perseus-shareddb
# - perseus-solr

perseus-r-serve:
profiles: [ "perseus-r-serve", "perseus" ]
Expand All @@ -566,8 +564,8 @@ services:
container_name: perseus-r-serve
ports:
- "6311:6311"
depends_on:
- perseus-shareddb
#depends_on:
# - perseus-shareddb

perseus-data-quality-dashboard:
profiles: [ "perseus-dqd", "perseus" ]
Expand All @@ -580,10 +578,10 @@ services:
SPRING_PROFILES_ACTIVE: docker
SPRING_DATASOURCE_URL: jdbc:postgresql://perseus-shareddb:5432/shared
FILES_MANAGER_URL: http://perseus-files-manager:10500/files-manager
depends_on:
- perseus-shareddb
- perseus-files-manager
- perseus-r-serve
#depends_on:
# - perseus-shareddb
# - perseus-files-manager
# - perseus-r-serve

perseus-swagger:
profiles: [ "perseus-swagger", "perseus" ]
Expand All @@ -605,9 +603,9 @@ services:
SPRING_PROFILES_ACTIVE: docker
SPRING_DATASOURCE_URL: jdbc:postgresql://perseus-shareddb:5432/shared
files-manager-url: "http://perseus-files-manager:10500/files-manager"
depends_on:
- perseus-shareddb
- perseus-files-manager
#depends_on:
# - perseus-shareddb
# - perseus-files-manager


secrets:
Expand Down
135 changes: 135 additions & 0 deletions perseus/web/server.docker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
server {
listen 80;
listen [::]:80;
server_name _;


location / {
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:4200;
# proxy_pass http://host.docker.internal:4200;

}

location /backend {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:5000;
}

location /user {
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:5001;
}

location /user/api/is_token_valid_internal {
if ($request_uri ~ .*\/api\/info$) {
return 200;
}
if ($request_method = 'OPTIONS') {
return 200;
}
internal;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_pass http://172.17.0.1:5001;

proxy_cache token_responses;
proxy_cache_key $http_Authorization;
proxy_cache_lock on;
proxy_cache_valid 200 300s;
proxy_cache_use_stale error timeout;
}

location /white-rabbit {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8000;
}

location /cdm-builder {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:9000;
}

location /data-quality-dashboard/api {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8001;
}

location /data-quality-dashboard {
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8001;
}

location /athena {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:5002;
}

location /solr {
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8983;
#include /etc/nginx/whitelist.conf;
}

location /usagi {
auth_request /user/api/is_token_valid_internal;
auth_request_set $username $upstream_http_Username;
proxy_set_header Username $username;
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:5003;
}

location /swagger {
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;
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8080;
}
}

0 comments on commit e9b1ddd

Please sign in to comment.