forked from cohere-ai/cohere-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCP one click deployment changes - DRAFT
- Loading branch information
1 parent
658332d
commit fe1f9f1
Showing
7 changed files
with
193 additions
and
51 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
{ | ||
"name": "one-click-demo", | ||
"name": "toolkit-deploy", | ||
"env": { | ||
"DATABASE_URI": { | ||
"description": "URI for your Postgres database", | ||
"default": "postgresql+psycopg2://postgre:postgre@localhost:5432/toolkit" | ||
"DATABASE_URL": { | ||
"description": "URL for your Postgres database" | ||
}, | ||
"COHERE_API_KEY": { | ||
"description": "Your Cohere API key" | ||
} | ||
}, | ||
"hooks": { | ||
"prebuild": { | ||
"commands": [ | ||
"gcloud auth configure-docker" | ||
] | ||
} | ||
}, | ||
"options": { | ||
"allow-unauthenticated": true | ||
"allow-unauthenticated": true, | ||
"memory": "12288Mi", | ||
"cpu": "4", | ||
"port": 8090, | ||
"max-instances": 2 | ||
} | ||
} |
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,17 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# shellcheck source=runtime/functions | ||
source "${PG_APP_HOME}/functions" | ||
|
||
[[ ${DEBUG} == true ]] && set -x | ||
|
||
# default behaviour is to launch apps | ||
if [[ -z ${1} ]]; then | ||
run_nginx | ||
run_frontend_proxy | ||
run_terrarium | ||
run_backend | ||
else | ||
exec "$@" | ||
fi |
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,85 @@ | ||
user www-data; | ||
worker_processes auto; | ||
pid /run/nginx.pid; | ||
include /etc/nginx/modules-enabled/*.conf; | ||
|
||
events { | ||
worker_connections 768; | ||
# multi_accept on; | ||
} | ||
|
||
http { | ||
|
||
## | ||
# Basic Settings | ||
## | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
client_max_body_size 50M; | ||
# server_tokens off; | ||
|
||
# server_names_hash_bucket_size 64; | ||
# server_name_in_redirect off; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
upstream backend { | ||
server 127.0.0.1:8000; | ||
} | ||
|
||
upstream frontend { | ||
server 127.0.0.1:4000; | ||
} | ||
|
||
server { | ||
listen 8090 default_server; | ||
listen [::]:8090 default_server; | ||
|
||
location /api { | ||
rewrite /api/(.*) /$1 break; | ||
proxy_pass http://backend; | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
} | ||
|
||
location / { | ||
proxy_pass http://frontend; | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
} | ||
} | ||
|
||
## | ||
# SSL Settings | ||
## | ||
|
||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE | ||
ssl_prefer_server_ciphers on; | ||
|
||
## | ||
# Logging Settings | ||
## | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
## | ||
# Gzip Settings | ||
## | ||
|
||
gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites-enabled/*; | ||
} |