From 520f0ab751d165418f44a6bd35800bd3f661a0ad Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Fri, 18 Aug 2017 15:04:42 +0100 Subject: [PATCH] allow custom nginx.conf and enable lua support closes #128 --- Dockerfile | 13 ++++++++++++- docs/versioning.md | 7 ++++--- scripts/start.sh | 4 ++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63aa89c..83842db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini ENV NGINX_VERSION 1.13.4 +ENV LUA_MODULE_VERSION 0.10.10 +ENV DEVEL_KIT_MODULE_VERSION 0.3.0 +ENV LUAJIT_LIB=/usr/lib +ENV LUAJIT_INC=/usr/include/luajit-2.0 RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ && CONFIG="\ @@ -54,6 +58,8 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ --with-compat \ --with-file-aio \ --with-http_v2_module \ + --add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \ + --add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \ " \ && addgroup -S nginx \ && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ @@ -72,15 +78,20 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ gd-dev \ geoip-dev \ perl-dev \ + luajit-dev \ && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ && curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ + && curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \ + && curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEYS" \ && gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ && rm -r "$GNUPGHOME" nginx.tar.gz.asc \ && mkdir -p /usr/src \ && tar -zxC /usr/src -f nginx.tar.gz \ - && rm nginx.tar.gz \ + && tar -zxC /usr/src -f ndk.tar.gz \ + && tar -zxC /usr/src -f lua.tar.gz \ + && rm nginx.tar.gz ndk.tar.gz lua.tar.gz \ && cd /usr/src/nginx-$NGINX_VERSION \ && ./configure $CONFIG --with-debug \ && make -j$(getconf _NPROCESSORS_ONLN) \ diff --git a/docs/versioning.md b/docs/versioning.md index d68ad62..53029d3 100644 --- a/docs/versioning.md +++ b/docs/versioning.md @@ -26,9 +26,10 @@ The latest tag will always follow the master branch in git. the other versions w | 1.2.1 | 1.2.1 |1.13.1 | 7.1.6 | 3.4 | 0.2.9 | | 1.2.2 | 1.2.2 |1.13.2 | 7.1.7 | 3.4 | 0.2.9 | | 1.2.3 | 1.2.3 |1.13.3 | 7.1.7 | 3.4 | 0.2.9 | -| 1.2.4 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.9 | -| 1.2.5 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.10 | -| 1.2.6 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.11 | +| 1.2.4 | 1.2.4 |1.13.4 | 7.1.8 | 3.4 | 0.2.9 | +| 1.2.5 | 1.2.5 |1.13.4 | 7.1.8 | 3.4 | 0.2.10 | +| 1.2.6 | 1.2.6 |1.13.4 | 7.1.8 | 3.4 | 0.2.11 | +| 1.3.0 | 1.3.0 |1.13.4 | 7.1.8 | 3.4 | 0.3.0 | These tags will be created as releases on GitHub and as tags in docker hub. diff --git a/scripts/start.sh b/scripts/start.sh index 44edbeb..941eb12 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -69,6 +69,10 @@ if [ -f "/var/www/html/composer.lock" ]; then fi # Enable custom nginx config files if they exist +if [ -f /var/www/html/conf/nginx/nginx.conf ]; then + cp /var/www/html/conf/nginx/nginx.conf /etc/nginx/nginx.conf +fi + if [ -f /var/www/html/conf/nginx/nginx-site.conf ]; then cp /var/www/html/conf/nginx/nginx-site.conf /etc/nginx/sites-available/default.conf fi