File tree Expand file tree Collapse file tree 4 files changed +46
-0
lines changed
pgstac/stac_fastapi/pgstac
sqlalchemy/stac_fastapi/sqlalchemy Expand file tree Collapse file tree 4 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 11version : ' 3'
22services :
3+ nginx :
4+ image : nginx
5+ ports :
6+ - 80:80
7+ volumes :
8+ - ./nginx.conf:/etc/nginx/nginx.conf
9+ depends_on :
10+ - app-pgstac
11+ - app-sqlalchemy
12+ command : ["nginx-debug", "-g", "daemon off;"]
13+
314 app-sqlalchemy :
415 container_name : stac-fastapi-sqlalchemy
516 image : stac-utils/stac-fastapi
@@ -19,6 +30,7 @@ services:
1930 - POSTGRES_HOST_WRITER=database
2031 - POSTGRES_PORT=5432
2132 - WEB_CONCURRENCY=10
33+ - UVICORN_ROOT_PATH=/api/v1/sqlalchemy
2234 ports :
2335 - " 8081:8081"
2436 volumes :
@@ -50,6 +62,7 @@ services:
5062 - DB_MIN_CONN_SIZE=1
5163 - DB_MAX_CONN_SIZE=1
5264 - USE_API_HYDRATE=${USE_API_HYDRATE:-false}
65+ - UVICORN_ROOT_PATH=/api/v1/pgstac
5366 ports :
5467 - " 8082:8082"
5568 volumes :
Original file line number Diff line number Diff line change 1+ events {}
2+
3+ http {
4+ server {
5+ listen 80 ;
6+
7+ location /api/v1/pgstac {
8+ rewrite ^/api/v1/pgstac( .*) $ $1 break ;
9+ proxy_pass http ://app-pgstac:8082 ;
10+ proxy_set_header HOST $host ;
11+ proxy_set_header Referer $http_referer ;
12+ proxy_set_header X-Forwarded-For $remote_addr ;
13+ proxy_set_header X-Forwarded-Proto $scheme ;
14+ }
15+
16+ location /api/v1/sqlalchemy {
17+ rewrite ^/api/v1/sqlalchemy( .*) $ $1 break ;
18+ proxy_pass http ://app-sqlalchemy:8081 ;
19+ proxy_set_header HOST $host ;
20+ proxy_set_header Referer $http_referer ;
21+ proxy_set_header X-Forwarded-For $remote_addr ;
22+ proxy_set_header X-Forwarded-Proto $scheme ;
23+ }
24+
25+ location / {
26+ proxy_redirect off;
27+ }
28+ }
29+ }
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ def run():
8888 port = settings .app_port ,
8989 log_level = "info" ,
9090 reload = settings .reload ,
91+ root_path = os .getenv ("UVICORN_ROOT_PATH" , "" ),
9192 )
9293 except ImportError :
9394 raise RuntimeError ("Uvicorn must be installed in order to use command" )
Original file line number Diff line number Diff line change 11"""FastAPI application."""
2+ import os
3+
24from stac_fastapi .api .app import StacApi
35from stac_fastapi .api .models import create_get_request_model , create_post_request_model
46from stac_fastapi .extensions .core import (
@@ -55,6 +57,7 @@ def run():
5557 port = settings .app_port ,
5658 log_level = "info" ,
5759 reload = settings .reload ,
60+ root_path = os .getenv ("UVICORN_ROOT_PATH" , "" ),
5861 )
5962 except ImportError :
6063 raise RuntimeError ("Uvicorn must be installed in order to use command" )
You can’t perform that action at this time.
0 commit comments