File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ exec /opt/mysql-proxy/bin/mysql-proxy \\\\\n\
2323--plugins=proxy \\\\\n \
2424--proxy-address=\$ {PROXY_DB_HOST}:\$ {PROXY_DB_PORT} \\\\\n \
2525--proxy-backend-addresses=\$ {REMOTE_DB_HOST}:\$ {REMOTE_DB_PORT} \\\\\n \
26- --proxy-lua-script=\$ {PROXY_LUA_SCRIPT }\n \
26+ --proxy-lua-script=\$ {LUA_SCRIPT }\n \
2727" >> /opt/entrypoint.sh && \
2828 chmod u+x /opt/entrypoint.sh
2929EXPOSE 4040 4041
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ services:
5353 PROXY_DB_PORT: 3306
5454 REMOTE_DB_HOST: mysql
5555 REMOTE_DB_PORT: 3306
56- PROXY_LUA_SCRIPT : "/opt/mysql-proxy/conf/main.lua"
56+ LUA_SCRIPT : "/opt/mysql-proxy/conf/main.lua"
5757 depends_on:
5858 - mysql
5959```
7979 PROXY_DB_PORT: 3306
8080 REMOTE_DB_HOST: mysql
8181 REMOTE_DB_PORT: 3306
82- PROXY_LUA_SCRIPT: "/opt/mysql-proxy/conf/log.lua"
82+ LUA_SCRIPT: "/opt/mysql-proxy/conf/log.lua"
83+ LOG_FILE: "/opt/mysql-proxy/logs/mysql.log"
8384...
8485```
8586
8687` /mysql-proxy/log.lua ` https://gist.github.com/simonw/1039751
8788```
88- local log_file = '/opt/mysql-proxy/logs/mysql.log'
89+ local log_file = os.getenv("LOG_FILE")
8990
9091local fh = io.open(log_file, "a+")
9192
Original file line number Diff line number Diff line change 2727-- This script will log the current date and time, the connection id
2828-- and the query to a file named "mysql.log"
2929--
30- local log_file = ' /opt/mysql-proxy/logs/mysql.log '
30+ local log_file = os.getenv ( " LOG_FILE " )
3131
3232local fh = io.open (log_file , " a+" )
3333
You can’t perform that action at this time.
0 commit comments