Last active
May 31, 2021 11:03
-
-
Save omervk/1bebf33379e0b2511490894a13c46f40 to your computer and use it in GitHub Desktop.
Debugging Lua inside Openresty inside Docker with IntelliJ IDEA - Blogpost Steps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env DEBUG_SOURCES_DIR; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN curl https://github.com/EmmyLua/EmmyLuaDebugger/archive/refs/tags/1.0.16.tar.gz \ | |
-L -o EmmyLuaDebugger-1.0.16.tar.gz && \ | |
tar -xzvf EmmyLuaDebugger-1.0.16.tar.gz && \ | |
cd EmmyLuaDebugger-1.0.16 && \ | |
mkdir -p build && \ | |
cd build && \ | |
cmake -DCMAKE_BUILD_TYPE=Release ../ && \ | |
make install && \ | |
mkdir -p /usr/local/emmy && \ | |
cp install/bin/emmy_core.so /usr/local/emmy/ && \ | |
cd .. && \ | |
cd .. && \ | |
rm -rf EmmyLuaDebugger-1.0.16 EmmyLuaDebugger-1.0.16.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package.cpath = package.cpath .. ';/Users/omer_van_kloeten/Library/Application Support/JetBrains/IntelliJIdea2021.1/plugins/EmmyLua/classes/debugger/emmy/mac/?.dylib' | |
local dbg = require('emmy_core') | |
dbg.tcpListen('localhost', 9966) | |
dbg.waitIDE() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DEBUG_SOURCES_DIR="/Users/omer_van_kloeten/my_project/src" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
nginx: | |
ports: | |
- "9966:9966" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lua_code_cache off; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN curl https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz \ | |
-o cmake-3.7.2.tar.gz && \ | |
tar -xvzf cmake-3.7.2.tar.gz && \ | |
cd cmake-3.7.2 && \ | |
./configure && \ | |
make && \ | |
make install && \ | |
cd .. && \ | |
rm -rf cmake-3.7.2 cmake-3.7.2.tar.gz && \ | |
update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package.cpath = package.cpath .. ';/usr/local/emmy/?.so' | |
local dbg = require('emmy_core') | |
dbg.tcpListen('localhost', 9966) | |
dbg.waitIDE() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
nginx: | |
environment: | |
DEBUG_SOURCES_DIR: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_G.emmy = {} | |
_G.emmy.fixPath = function(path) | |
return string.gsub(path, '/etc/nginx/', ‘/Users/omer_van_kloeten/my_project/src/') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx: | |
volumes: | |
- "./src/lua:/etc/nginx/lua:ro" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local debug_sources_dir = os.getenv('DEBUG_SOURCES_DIR') | |
_G.emmy = {} | |
_G.emmy.fixPath = function(path) | |
return string.gsub(path, '/etc/nginx/', debug_sources_dir..'/') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These snippets are used in the Debugging Lua inside Openresty inside Docker with IntelliJ IDEA blogpost.