Skip to content

Commit d220f33

Browse files
author
Konstantin Nazarov
committed
Add docker-compose example
1 parent 06ed223 commit d220f33

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docker-compose.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: '2'
2+
services:
3+
tarantool:
4+
image: tarantool/tarantool
5+
command: |
6+
/bin/sh -c '/bin/sh -s <<EOF
7+
ls -l /opt/tarantool
8+
echo "foo"
9+
cat > /opt/tarantool/app.lua <<EON
10+
box.cfg{}
11+
function tnt_rest(req)
12+
return "Hello from Tarantool"
13+
end
14+
EON
15+
ls -l /opt/tarantool
16+
ls -l /opt/tarantool/app.lua
17+
tarantool /usr/local/bin/tarantool-entrypoint.lua /opt/tarantool/app.lua
18+
EOF'
19+
20+
21+
nginx:
22+
image: tarantool/tarantool-nginx
23+
depends_on:
24+
- tarantool
25+
volumes:
26+
- ./tarantool.template:/etc/nginx/conf.d/tarantool.template
27+
ports:
28+
- "8080:8080"
29+
command: |
30+
/bin/sh -c '/bin/sh -s <<EOF
31+
cat > /etc/nginx/conf.d/default.conf <<EON
32+
upstream backend {
33+
server tarantool:3301;
34+
}
35+
36+
server {
37+
listen 8080;
38+
server_name localhost;
39+
40+
location /tnt_rest {
41+
tnt_http_rest_methods get post put delete;
42+
tnt_pass_http_request on;
43+
tnt_multireturn_skip_count 2;
44+
tnt_pure_result on;
45+
tnt_pass backend;
46+
add_header Content-Type text/plain;
47+
}
48+
}
49+
EON
50+
nginx -g "daemon off;"
51+
EOF'

0 commit comments

Comments
 (0)