Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion deploy/gcp/01-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ fi

if [[ -n "$DB_PASSWORD" ]]; then
# Cloud Run connects over a unix socket at /cloudsql/<connection-name>.
DB_URL="postgresql://${DB_USER}:${DB_PASSWORD}@localhost/${DB_NAME}?host=/cloudsql/${CONNECTION_NAME}"
# connection_limit caps Prisma's per-instance pool so max instances x 4 stays
# under db-g1-small's 50-connection limit.
DB_URL="postgresql://${DB_USER}:${DB_PASSWORD}@localhost/${DB_NAME}?host=/cloudsql/${CONNECTION_NAME}&connection_limit=4"
secret_put "$DB_URL_SECRET" "$DB_URL"
info "Stored connection string in secret '${DB_URL_SECRET}'."
fi
Expand Down
4 changes: 2 additions & 2 deletions deploy/gcp/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ fi
: "${DB_INSTANCE:=keepcontracts-db}"
: "${DB_NAME:=keepcontracts}"
: "${DB_USER:=keepcontracts}"
: "${DB_TIER:=db-custom-1-3840}"
: "${DB_TIER:=db-g1-small}"
: "${SECRET_PREFIX:=$SERVICE}"
: "${UPLOAD_TRANSPORT:=database}"
: "${RUN_MEMORY:=2Gi}"
: "${RUN_CPU:=2}"
: "${RUN_CPU:=1}"
: "${RUN_MIN_INSTANCES:=1}"
: "${RUN_MAX_INSTANCES:=10}"
: "${RUN_CONCURRENCY:=40}"
Expand Down
4 changes: 2 additions & 2 deletions deploy/gcp/config.example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export SERVICE="keepcontracts"
export DB_INSTANCE="keepcontracts-db"
export DB_NAME="keepcontracts"
export DB_USER="keepcontracts"
export DB_TIER="db-custom-1-3840"
export DB_TIER="db-g1-small"

# Secrets are named "<SECRET_PREFIX>-enc-key", etc. Defaults to SERVICE.
# export SECRET_PREFIX="keepcontracts"
Expand All @@ -40,7 +40,7 @@ export WEBAPP_URL="https://keepcontracts.com"
# ─── Cloud Run sizing ────────────────────────────────────────────────────────

export RUN_MEMORY="2Gi"
export RUN_CPU="2"
export RUN_CPU="1"
# Keep at least 1 warm instance: the default in-process background-jobs provider
# ("local") only runs scheduled work while an instance is alive.
export RUN_MIN_INSTANCES="1"
Expand Down
Loading