1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 03:48:44 +00:00

add mysql-proxy

This commit is contained in:
kev 2016-05-09 21:33:08 +08:00
parent c16d1cc6d6
commit 0cd923ef0b
4 changed files with 40 additions and 0 deletions

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

@ -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

@ -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

@ -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