(and Heroku-compatibles like Dokku)
- Support for the full OpenResty suite including OPM and the Resty CLI
- Built-in support for installing packages from LuaRocks
- Full control of the top-level
nginx.conf
and the$LUA_PATH
/$LUA_CPATH
environment variables - Easily declare Lua dependencies by listing them in
opm.txt
and/orluarocks.txt
in your project's root directory
The easiest way to get started with this buildpack is to check out the Hello World app.
Clone the Hello World app
$ git clone https://github.com/benwilber/heroku-openresty-hello-world.git
$ cd heroku-openresty-hello-world
Create a new Heroku app
$ heroku apps:create --stack=heroku-20 --buildpack=https://github.com/benwilber/heroku-openresty-buildpack.git
We have to add the heroku/python
buildpack as well so that we can compile the nginx.conf
template.
$ heroku buildpacks:add heroku/python
Push the app to Heroku
$ git push heroku master
Visiting the app's URL in your web browser will display "Hello Lapis!"
This buildpack has been tested with the following Heroku stacks:
heroku-16
heroku-18
heroku-20
If you're interested in making a custom build of OpenResty then take a look at the Makefile in the root of this repository. OpenResty (and dependencies) are compiled in Docker running the target stack.
$ make build-heroku-20
You can modify the bin/build
file to add or modify how OpenResty is built. For instance, if you want to add additional NGINX modules.