-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 1.14 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
version: '2'
services:
tarantool:
image: tarantool/tarantool
command: |
/bin/sh -c '/bin/sh -s <<EOF
cat > /opt/tarantool/app.lua <<EON
box.cfg{}
function tnt_rest(req)
return "Hello from Tarantool"
end
EON
tarantool /usr/local/bin/tarantool-entrypoint.lua /opt/tarantool/app.lua
EOF'
nginx:
image: tarantool/tarantool-nginx
depends_on:
- tarantool
volumes:
- ./tarantool.template:/etc/nginx/conf.d/tarantool.template
ports:
- "8080:8080"
command: |
/bin/sh -c '/bin/sh -s <<EOF
cat > /etc/nginx/conf.d/default.conf <<EON
upstream backend {
server tarantool:3301;
}
server {
listen 8080;
server_name localhost;
location /tnt_rest {
tnt_http_rest_methods get post put delete;
tnt_pass_http_request on;
tnt_pure_result on;
tnt_pass backend;
add_header Content-Type text/plain;
}
}
EON
nginx -g "daemon off;"
EOF'