mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-01-26 05:27:31 +02:00
add mysql-proxy
This commit is contained in:
parent
c16d1cc6d6
commit
0cd923ef0b
16
mysql-proxy/Dockerfile
Normal file
16
mysql-proxy/Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Dockerfile for mysql-proxy
|
||||
#
|
||||
|
||||
FROM debian:jessie
|
||||
MAINTAINER kev <noreply@easypi.info>
|
||||
|
||||
RUN set -xe \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y mysql-proxy \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
EXPOSE 4040
|
||||
|
||||
ENTRYPOINT ["mysql-proxy"]
|
||||
CMD ["--help"]
|
8
mysql-proxy/README.md
Normal file
8
mysql-proxy/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
mysql-proxy
|
||||
===========
|
||||
|
||||
[MySQL Proxy][1] is an application that communicates over the network using the
|
||||
MySQL client/server protocol and provides communication between one or more
|
||||
MySQL servers and one or more MySQL clients.
|
||||
|
||||
[1]: https://github.com/mysql/mysql-proxy
|
5
mysql-proxy/code.lua
Normal file
5
mysql-proxy/code.lua
Normal file
@ -0,0 +1,5 @@
|
||||
function read_query(packet)
|
||||
if packet:byte() == proxy.COM_QUERY then
|
||||
print("we got a normal query: " .. packet:sub(2))
|
||||
end
|
||||
end
|
11
mysql-proxy/docker-compose.yml
Normal file
11
mysql-proxy/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
mysql-proxy:
|
||||
image: vimagick/mysql-proxy
|
||||
command: >
|
||||
--proxy-address=:4040
|
||||
--proxy-backend-addresses=mysql-server:3306
|
||||
--proxy-lua-script=/code.lua
|
||||
ports:
|
||||
- "3306:4040"
|
||||
volumes:
|
||||
- ./code.lua:/code.lua
|
||||
restart: always
|
Loading…
x
Reference in New Issue
Block a user