Skip to content

Commit

Permalink
fix: start cloud SQL proxy in the background
Browse files Browse the repository at this point in the history
  • Loading branch information
ngurenyaga committed Jul 12, 2021
1 parent 7c96b14 commit 7032ea9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,5 @@ pepfar_mle/media/
!.envs/.local/

secrets/*
cloud_sql_proxy

5 changes: 3 additions & 2 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ set -o nounset
if [ -z "${CLOUD_SQL_PROXY_VERSION}" ]; then
export CLOUD_SQL_PROXY_VERSION=v1.23.0 # see https://github.com/GoogleCloudPlatform/cloudsql-proxy/releases
fi
wget "https://storage.googleapis.com/cloudsql-proxy/$VERSION/cloud_sql_proxy.linux.amd64" -O cloud_sql_proxy
wget "https://storage.googleapis.com/cloudsql-proxy/$CLOUD_SQL_PROXY_VERSION/cloud_sql_proxy.linux.amd64" -O cloud_sql_proxy
chmod +x cloud_sql_proxy
cloud_sql_proxy -dir=/cloudsql -instances=$INSTANCE_CONNECTION_NAME & # run in the background!
cloud_sql_proxy -verbose -structured_logs -dir=/cloudsql -instances=$INSTANCE_CONNECTION_NAME & # run in the background!
sleep 10 # allow time for the proxy to start
echo "Created Cloud SQL Proxy at $INSTANCE_CONNECTION_NAME, running in the background"

if [ -z "${POSTGRES_USER}" ]; then
Expand Down

0 comments on commit 7032ea9

Please sign in to comment.