-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nginx service as second docker-compose stack (#503)
* add nginx service to docker-compose, proxy pgstac and sqlalchemy apps * Update docker-compose.yml Co-authored-by: Christian Wygoda <[email protected]> * feat: add nginx proxy in own docker-compose file Includes a Makefile rule to run it, and some documentation in README.md. Also adds a markdownlint silencer and one or two touchups to the whitespace. * Update changelog --------- Co-authored-by: Christian Wygoda <[email protected]> Co-authored-by: Pete Gadomski <[email protected]> Co-authored-by: Nathan Zimmerman <[email protected]>
- Loading branch information
1 parent
2482467
commit 1de7b8b
Showing
7 changed files
with
75 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3' | ||
services: | ||
nginx: | ||
image: nginx | ||
ports: | ||
- ${STAC_FASTAPI_NGINX_PORT:-80}:80 | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
depends_on: | ||
- app-pgstac | ||
- app-sqlalchemy | ||
command: [ "nginx-debug", "-g", "daemon off;" ] | ||
app-pgstac: | ||
environment: | ||
- UVICORN_ROOT_PATH=/api/v1/pgstac | ||
app-sqlalchemy: | ||
environment: | ||
- UVICORN_ROOT_PATH=/api/v1/sqlalchemy |
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,29 @@ | ||
events {} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
|
||
location /api/v1/pgstac { | ||
rewrite ^/api/v1/pgstac(.*)$ $1 break; | ||
proxy_pass http://app-pgstac:8082; | ||
proxy_set_header HOST $host; | ||
proxy_set_header Referer $http_referer; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /api/v1/sqlalchemy { | ||
rewrite ^/api/v1/sqlalchemy(.*)$ $1 break; | ||
proxy_pass http://app-sqlalchemy:8081; | ||
proxy_set_header HOST $host; | ||
proxy_set_header Referer $http_referer; | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location / { | ||
proxy_redirect 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
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