├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Erik Wickstrom 3 | 4 | # install build dependencies 5 | RUN apt-get -qq update && apt-get -qqy install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make curl git-core luarocks 6 | 7 | # build/install OpenResty 8 | ENV SRC_DIR /opt 9 | ENV OPENRESTY_VERSION 1.13.6.1 10 | ENV OPENRESTY_PREFIX /opt/openresty 11 | ENV LAPIS_VERSION 1.6.0 12 | 13 | RUN cd $SRC_DIR && curl -LOs https://openresty.org/download/openresty-$OPENRESTY_VERSION.tar.gz \ 14 | && tar xzf openresty-$OPENRESTY_VERSION.tar.gz && cd openresty-$OPENRESTY_VERSION \ 15 | && ./configure --prefix=$OPENRESTY_PREFIX \ 16 | --with-luajit \ 17 | --with-http_realip_module \ 18 | --with-http_stub_status_module \ 19 | && make && make install && rm -rf openresty-$OPENRESTY_VERSION* 20 | 21 | RUN luarocks install --server=http://rocks.moonscript.org/manifests/leafo lapis $LAPIS_VERSION 22 | RUN luarocks install moonscript 23 | RUN luarocks install lapis-console 24 | 25 | WORKDIR $OPENRESTY_PREFIX/nginx/conf 26 | 27 | ENV LAPIS_OPENRESTY $OPENRESTY_PREFIX/nginx/sbin/nginx 28 | 29 | EXPOSE 8080 30 | EXPOSE 80 31 | 32 | # Setup sample lapis project. 33 | RUN mv nginx.conf nginx.conf.bk && lapis new && moonc *.moon 34 | 35 | # LAPIS_OPENRESTY=/opt/openresty/nginx/sbin/nginx lapis server production 36 | ENTRYPOINT ["lapis"] 37 | CMD ["server", "production"] 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 erikcw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-lapis 2 | ============ 3 | 4 | This image aims to provide a clean docker base image for the latest version of the Lapis Lua web framework (backed by OpenResty). 5 | 6 | OpenResty is installed at `/opt/openresty`. To use this image, place your Lapis application files in `/opt/openresty/nginx/conf` (either by attaching a docker volume or Creating a new Dockerfile `FROM erikcw/lapis:latest`.). 7 | --------------------------------------------------------------------------------