Skip to content

Commit

Permalink
Add sample docker-compose.yml (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
McPizza0 committed Dec 20, 2023
1 parent 5ca211a commit 341b722
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,17 @@ Compiled binaries can be found in GitHub Releases: https://github.com/mattrobeno

Images are published to [ghcr.io/mattrobenolt/ps-http-sim:latest](https://github.com/mattrobenolt/ps-http-sim/pkgs/container/ps-http-sim)

### docker-compose
A sample docker-compose.yml is available in the examples folder.
This will spin up a mysql server on the default port of 3306, and ps-http-sim on port 3900.

When setting up your connection, the config object needs to use the `url` property with a `http://` address with a non-null password, instead of `host`, `username` & `password`.
e.g. `{ url: 'http://root:nonNullPassword@localhost:3900'}`
Using `host` will force https.

You can connect directly to the mysql server using a mysql uri
`mysql://root:nonNullPassword@localhost/planetscale`

## Build from source

Go is required:
Expand Down
35 changes: 35 additions & 0 deletions example/docker-compose.yml
@@ -0,0 +1,35 @@
version: "3.8"
services:
ps-mysql:
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: planetscale
MYSQL_ROOT_HOST: "%"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
command:
[
"--max_connections=1000",
"--default-authentication-plugin=mysql_native_password",
]
ports:
- 3306:3306
volumes:
- ps-mysql:/var/lib/mysql
planetscale-proxy:
image: ghcr.io/mattrobenolt/ps-http-sim:latest
command:
[
"-mysql-no-pass",
"-listen-port=3900",
"-mysql-dbname=planetscale",
"-mysql-addr=ps-mysql",
]
depends_on:
- ps-mysql
ports:
- 3900:3900
links:
- ps-mysql
volumes:
ps-mysql:

0 comments on commit 341b722

Please sign in to comment.