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 1
1
version : ' 3'
2
2
services :
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
+
3
14
app-sqlalchemy :
4
15
container_name : stac-fastapi-sqlalchemy
5
16
image : stac-utils/stac-fastapi
@@ -19,6 +30,7 @@ services:
19
30
- POSTGRES_HOST_WRITER=database
20
31
- POSTGRES_PORT=5432
21
32
- WEB_CONCURRENCY=10
33
+ - UVICORN_ROOT_PATH=/api/v1/sqlalchemy
22
34
ports :
23
35
- " 8081:8081"
24
36
volumes :
@@ -50,6 +62,7 @@ services:
50
62
- DB_MIN_CONN_SIZE=1
51
63
- DB_MAX_CONN_SIZE=1
52
64
- USE_API_HYDRATE=${USE_API_HYDRATE:-false}
65
+ - UVICORN_ROOT_PATH=/api/v1/pgstac
53
66
ports :
54
67
- " 8082:8082"
55
68
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():
88
88
port = settings .app_port ,
89
89
log_level = "info" ,
90
90
reload = settings .reload ,
91
+ root_path = os .getenv ("UVICORN_ROOT_PATH" , "" ),
91
92
)
92
93
except ImportError :
93
94
raise RuntimeError ("Uvicorn must be installed in order to use command" )
Original file line number Diff line number Diff line change 1
1
"""FastAPI application."""
2
+ import os
3
+
2
4
from stac_fastapi .api .app import StacApi
3
5
from stac_fastapi .api .models import create_get_request_model , create_post_request_model
4
6
from stac_fastapi .extensions .core import (
@@ -55,6 +57,7 @@ def run():
55
57
port = settings .app_port ,
56
58
log_level = "info" ,
57
59
reload = settings .reload ,
60
+ root_path = os .getenv ("UVICORN_ROOT_PATH" , "" ),
58
61
)
59
62
except ImportError :
60
63
raise RuntimeError ("Uvicorn must be installed in order to use command" )
You can’t perform that action at this time.
0 commit comments