Name: pantheon-mysql-proxy
Owner: Pantheon
Description: Docker-based static proxy to forward MySQL queries to a configurable Pantheon site/env.
Forked from: tableau-mkt/pantheon-mysql-proxy
Created: 2017-01-27 18:55:44.0
Updated: 2017-01-27 18:55:47.0
Pushed: 2016-11-18 21:25:48.0
Homepage: https://hub.docker.com/r/tableaumkt/pantheon-mysql-proxy/
Size: 10
Language: Lua
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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-proxy
docker build -t="tableaumkt/pantheon-mysql-proxy" github.com/tableau-mkt/pantheon-mysql-proxy
You should be able to deploy this image directly; everything you need to change is made configurable via environment variables or arguments, outlined below.
er run \
"PROXY_DB_UN=pantheon_proxy" \
"PROXY_DB_PW=batteryhorsestaple" \
"PROXY_DB_PORT=3306" \
"PANTHEON_SITE=www-my-company" \
"PANTHEON_ENV=test" \
"PANTHEON_TOKEN=3x4mp130-1337-m4ch-1n30-t0k3n0000000" \
3306:3306/tcp \
--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.