pantheon-systems/pantheon-mysql-proxy

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Pantheon Switchboard

The Pantheon Switchboard 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.

Installation
  1. Install Docker.
  2. Download the automated build from the Docker Hub Registry: docker pull tableaumkt/pantheon-mysql-proxy
  3. Alternatively, you can build an image from the Dockerfile: docker build -t="tableaumkt/pantheon-mysql-proxy" github.com/tableau-mkt/pantheon-mysql-proxy
Usage

You should be able to deploy this image directly; everything you need to change is made configurable via environment variables or arguments, outlined below.

Example run command:
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

Configurable variables Arguments

There are also some run-time arguments that you can provide to alter the way the connection is made back to Pantheon.

Queries no longer forwarding to the right database?

Simply restart or re-deploy the docker image; Pantheon MySQL connection info and credentials are pulled and cached on start-up.

Base docker image

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.