planetscale / sql-proxy

SQL Proxy for PlanetScale DB
Apache License 2.0
54 stars 6 forks source link

Add Docker container support #88

Closed fatih closed 3 years ago

fatih commented 3 years ago

This PR adds a Dockerfile to containerize the cmd/sql-proxy-client binary. It's similar to what we have done in our CLI repository: https://github.com/planetscale/cli/pull/289

Here is an example to run the container and publish the proxy on host address 127.0.0.1:3306:

$ docker run -p 127.0.0.1:3306:3306 planetscale/pscale-proxy:latest \
  --host 0.0.0.0 \
  --org "$PLANETSCALE_ORG" \
  --database "$PLANETSCALE_DATABASE" \
  --branch "$PLANETSCALE_BRANCH" \
  --service-token "$PLANETSCALE_SERVICE_TOKEN" \
  --service-token-name "$PLANETSCALE_SERVICE_TOKEN_NAME"