File tree 3 files changed +6
-5
lines changed
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\
23
23
--plugins=proxy \\\\\n \
24
24
--proxy-address=\$ {PROXY_DB_HOST}:\$ {PROXY_DB_PORT} \\\\\n \
25
25
--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 \
27
27
" >> /opt/entrypoint.sh && \
28
28
chmod u+x /opt/entrypoint.sh
29
29
EXPOSE 4040 4041
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ services:
53
53
PROXY_DB_PORT: 3306
54
54
REMOTE_DB_HOST: mysql
55
55
REMOTE_DB_PORT: 3306
56
- PROXY_LUA_SCRIPT : "/opt/mysql-proxy/conf/main.lua"
56
+ LUA_SCRIPT : "/opt/mysql-proxy/conf/main.lua"
57
57
depends_on:
58
58
- mysql
59
59
```
79
79
PROXY_DB_PORT: 3306
80
80
REMOTE_DB_HOST: mysql
81
81
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"
83
84
...
84
85
```
85
86
86
87
` /mysql-proxy/log.lua ` https://gist.github.com/simonw/1039751
87
88
```
88
- local log_file = '/opt/mysql-proxy/logs/mysql.log'
89
+ local log_file = os.getenv("LOG_FILE")
89
90
90
91
local fh = io.open(log_file, "a+")
91
92
Original file line number Diff line number Diff line change 27
27
-- This script will log the current date and time, the connection id
28
28
-- and the query to a file named "mysql.log"
29
29
--
30
- local log_file = ' /opt/mysql-proxy/logs/mysql.log '
30
+ local log_file = os.getenv ( " LOG_FILE " )
31
31
32
32
local fh = io.open (log_file , " a+" )
33
33
You can’t perform that action at this time.
0 commit comments