Tarantool nginx upstream module
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-compose.yml 1.1KB

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