Skip to content

Commit

Permalink
feat: install cloud SQL proxy via a shell file
Browse files Browse the repository at this point in the history
  • Loading branch information
ngurenyaga committed Jul 12, 2021
1 parent 8a02b33 commit f03d578
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ RUN chown django:django ${APP_HOME}
USER django

# set up cloud SQL proxy
RUN wget "https://storage.googleapis.com/cloudsql-proxy/v1.23.0/cloud_sql_proxy.linux.amd64" -O /cloud_sql_proxy
RUN chmod +x /cloud_sql_proxy
COPY --chown=django:django ./install_cloudsql_proxy.sh /install_cloudsql_proxy.sh
RUN sed -i 's/\r$//g' /install_cloudsql_proxy.sh
RUN chmod +x /install_cloudsql_proxy.sh
RUN /install_cloudsql_proxy.sh

ENTRYPOINT ["/entrypoint"]
14 changes: 14 additions & 0 deletions install_cloudsql_proxy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -o errexit
set -o pipefail
set -o nounset

if [ -z "${CLOUD_SQL_PROXY_VERSION}" ]; then
export CLOUD_SQL_PROXY_VERSION=v1.23.0
fi

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

echo "Installed CloudSQL Proxy, version $CLOUD_SQL_PROXY_VERSION..."

0 comments on commit f03d578

Please sign in to comment.