allow custom nginx.conf and enable lua support closes #128

This commit is contained in:
Ric Harvey
2017-08-18 15:04:42 +01:00
parent 1b427c9c9b
commit 520f0ab751
3 changed files with 20 additions and 4 deletions

View File

@@ -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) \

View File

@@ -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.

View File

@@ -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