Skip to content

Commit

Permalink
Add build from docker-compose
Browse files Browse the repository at this point in the history
This commit adds a minimal build of a proxysql, mysql and readyset
via docker compose file.
  • Loading branch information
altmannmarcelo committed Sep 2, 2024
1 parent 8c55a36 commit d07603d
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ target/

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.vscode/
36 changes: 36 additions & 0 deletions build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3.8"
services:
proxysql:
image: proxysql/proxysql
ports:
- "6033:6033"
- "6032:6032"
volumes:
- ./proxysql.cnf:/etc/proxysql.cnf
mysql-master:
image: mysql:8.0
container_name: mysql-master
environment:
- MYSQL_ROOT_PASSWORD=noria
- MYSQL_DATABASE=noria
command: --server-id=1
ports:
- "3306:3306"
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -u root -pnoria"]
interval: 10s
retries: 20
start_period: 30s
timeout: 10s
readyset:
image: readysettech/readyset
ports:
- "3307:3307"
- "6034:6034"
environment:
- UPSTREAM_DB_URL=mysql://root:[email protected]:3306/noria
depends_on:
mysql-master:
condition: service_healthy
restart: true

30 changes: 30 additions & 0 deletions build/proxysql.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
admin_variables=
{
admin_credentials="admin:admin;radmin:radmin"
}

# defines all the MySQL servers
mysql_servers =
(
{ address="host.docker.internal" , port=3306 , hostgroup=1, comment="Source" },
{ address="host.docker.internal" , port=3307 , hostgroup=2, weight=1000, comment="Readyset" },
{ address="host.docker.internal" , port=3306 , hostgroup=2, weight=1, comment="Source" }
)

mysql_variables=
{
monitor_username="root"
monitor_password="noria"
}

mysql_users:
(
{
username = "root"
password = "noria"
default_hostgroup = 1
max_connections=1000
default_schema="noria"
active = 1
}
)

0 comments on commit d07603d

Please sign in to comment.