Persist database connections to your Pantheon databases for analytics or development!
500K+
This repository contains a Dockerfile of MySQL proxy that will dynamically
proxy MySQL queries made against it to a pre-configured Pantheon site and
environment at runtime.
This allows you to configure and deploy a static endpoint with your choice of credentials that always points to your Pantheon site's database, despite periodic connection detail changes that occur as a result of server upgrades, endpoint migrations, etc.
docker pull tableaumkt/pantheon-mysql-proxydocker build -t="tableaumkt/pantheon-mysql-proxy" github.com/tableau-mkt/pantheon-mysql-proxyYou should be able to deploy this image directly; everything you need to change is made configurable via environment variables or arguments, outlined below.
docker run \
-e "PROXY_DB_UN=pantheon_proxy" \
-e "PROXY_DB_PW=batteryhorsestaple" \
-e "PROXY_DB_PORT=3306" \
-e "PANTHEON_SITE=www-my-company" \
-e "PANTHEON_ENV=test" \
-e "PANTHEON_TOKEN=3x4mp130-1337-m4ch-1n30-t0k3n0000000" \
-p 3306:3306/tcp \
-d --restart=always tableaumkt/pantheon-mysql-proxy --prefer-replica
These may also be configured/stored differently depending on your Docker deploy strategy.
Once deployed, you can connect to your proxy as if it were a MySQL instance
itself: mysql --host=your.proxy.io --port=3306 --user=pantheon_proxy -p
PROXY_DB_UN
PROXY_DB_PW
PROXY_DB_PORT
PANTHEON_SITE
PANTHEON_ENV
dev, test, or live).PANTHEON_TOKEN
There are also some run-time arguments that you can provide to alter the way the connection is made back to Pantheon.
--prefer-replica
--require-replica
Simply restart or re-deploy the docker image; Pantheon MySQL connection info and credentials are pulled and cached on start-up.
Content type
Image
Digest
sha256:6ed1a2d77…
Size
132.4 MB
Last updated
almost 8 years ago
docker pull tableaumkt/pantheon-mysql-proxy