-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a docker with nginx for using muleview/scent
- Loading branch information
Showing
4 changed files
with
174 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
FROM ubuntu:14.04 | ||
|
||
RUN apt-get update -y && apt-get install -y unzip curl make git | ||
|
||
|
||
RUN apt-get install -y lua5.1 liblua5.1 liblua5.1-dev | ||
|
||
# Install luarocks | ||
RUN cd /tmp && \ | ||
curl -L -O http://luarocks.org/releases/luarocks-2.2.1.tar.gz && \ | ||
tar zxpf luarocks-2.2.1.tar.gz && \ | ||
rm luarocks-2.2.1.tar.gz && \ | ||
cd luarocks-2.2.1 && \ | ||
./configure --prefix=/usr && \ | ||
make bootstrap && \ | ||
cd /tmp && \ | ||
rm -r /tmp/luarocks-2.2.1 | ||
|
||
RUN cd /tmp && \ | ||
curl -L -O https://github.com/LMDB/lmdb/archive/LMDB_0.9.15.tar.gz && \ | ||
tar -xzf LMDB_0.9.15.tar.gz && \ | ||
rm LMDB_0.9.15.tar.gz && \ | ||
cd lmdb-LMDB_0.9.15/libraries/liblmdb && \ | ||
make all install && \ | ||
ldconfig && \ | ||
cd /tmp && \ | ||
rm -r /tmp/lmdb-LMDB_0.9.15 | ||
|
||
RUN luarocks install bit32 | ||
RUN luarocks install copas 1.1.6-1 | ||
RUN luarocks install lightningmdb | ||
RUN luarocks install luaposix | ||
RUN apt-get install -y nginx-extras | ||
RUN apt-get install -y vim | ||
|
||
ENV HOME /root | ||
WORKDIR $HOME | ||
|
||
COPY *.lua $HOME/ | ||
COPY lunit-0.5 $HOME/lunit-0.5 | ||
COPY tests $HOME/tests | ||
COPY fdi $HOME/fdi/ | ||
COPY scent $HOME/scent | ||
COPY muleview $HOME/muleview | ||
COPY docker/nginx.mule.conf $HOME/ | ||
|
||
RUN ln -s /root/nginx.mule.conf /etc/nginx/sites-enabled/mule | ||
RUN mkdir -p /root/queues/mule_incoming | ||
RUN mkdir -p /root/queues/mule_processed | ||
RUN mkdir -p /root/queues/mule_work | ||
RUN chmod o+rw /root/queues/* | ||
RUN chown www-data scent muleview | ||
RUN chmod u+x scent muleview | ||
RUN chmod o+x /root | ||
|
||
RUN mkdir -p $HOME/tests/temp |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
server { | ||
listen 8080 default_server; | ||
server_name _; | ||
|
||
if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$) { | ||
return 403; | ||
} | ||
|
||
set $mule_root "/root"; | ||
|
||
|
||
location = /mule/api/graph { | ||
limit_except POST { deny all; } | ||
|
||
client_body_temp_path "/root/queues/mule_work/"; | ||
client_body_in_file_only on; | ||
client_body_buffer_size 128K; | ||
client_max_body_size 1000M; | ||
lua_need_request_body on; | ||
content_by_lua ' | ||
ngx.req.read_body() | ||
local body_file = ngx.req.get_body_file() | ||
local base_name = string.match(body_file,"/([^/]*)$") | ||
local content = io.open(body_file,"rb"):read("*all") | ||
|
||
local function write_to_path(content,path) | ||
local out = io.open(body_file..".tmp","wb") | ||
out:write(content) | ||
out:close() | ||
|
||
os.rename(body_file..".tmp",string.format("%s/%s-%s.mule",path,ngx.var.remote_addr,base_name)) | ||
end | ||
write_to_path(content,"/root/queues/mule_incoming") | ||
ngx.exit(202) | ||
'; | ||
} | ||
|
||
location /mule/api/ { | ||
gzip_proxied any; | ||
add_header Access-Control-Allow-Origin *; | ||
proxy_pass http://localhost:8981/; | ||
} | ||
|
||
rewrite ^/mule$ /mule/ permanent; | ||
|
||
location /mule/ { | ||
# change the path as necessary | ||
index index.html; | ||
alias "/root/muleview/build/production/"; | ||
expires 1d; | ||
} | ||
rewrite ^/scent$ /scent/ permanent; | ||
location /scent/ { | ||
# change the path as necessary | ||
root /root; | ||
index index.html; | ||
expires 1m; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
server { | ||
listen 80 default_server; | ||
server_name _; | ||
|
||
if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$) { | ||
return 403; | ||
} | ||
|
||
|
||
location = /mule/api/graph { | ||
limit_except POST { deny all; } | ||
|
||
client_body_temp_path '<mule_queues>/mule_work/'; | ||
client_body_in_file_only on; | ||
client_body_buffer_size 128K; | ||
client_max_body_size 1000M; | ||
lua_need_request_body on; | ||
content_by_lua ' | ||
ngx.req.read_body() | ||
local body_file = ngx.req.get_body_file() | ||
local base_name = string.match(body_file,"/([^/]*)$") | ||
local content = io.open(body_file,"rb"):read("*all") | ||
|
||
local function write_to_path(content,path) | ||
local out = io.open(body_file..".tmp","wb") | ||
out:write(content) | ||
out:close() | ||
|
||
os.rename(body_file..".tmp",string.format("%s/%s-%s.mule",path,ngx.var.remote_addr,base_name)) | ||
end | ||
write_to_path(content,"<mule_queues>/mule_incoming") | ||
ngx.exit(202) | ||
'; | ||
} | ||
|
||
location /mule/api/ { | ||
gzip_proxied any; | ||
add_header Access-Control-Allow-Origin *; | ||
proxy_pass http://localhost:8981/; | ||
} | ||
|
||
rewrite ^/mule$ /mule/ permanent; | ||
|
||
location /mule/ { | ||
# change the path as necessary | ||
index index.html; | ||
alias '<mule_code>/muleview/build/production/'; | ||
expires 1d; | ||
} | ||
rewrite ^/scent$ /scent/ permanent; | ||
location /scent/ { | ||
# change the path as necessary | ||
root <mule_code>; | ||
index index.html; | ||
expires 1m; | ||
} | ||
|
||
} |