Skip to content

Commit 520f0ab

Browse files
author
Ric Harvey
committed
allow custom nginx.conf and enable lua support closes #128
1 parent 1b427c9 commit 520f0ab

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ ENV fpm_conf /usr/local/etc/php-fpm.d/www.conf
77
ENV php_vars /usr/local/etc/php/conf.d/docker-vars.ini
88

99
ENV NGINX_VERSION 1.13.4
10+
ENV LUA_MODULE_VERSION 0.10.10
11+
ENV DEVEL_KIT_MODULE_VERSION 0.3.0
12+
ENV LUAJIT_LIB=/usr/lib
13+
ENV LUAJIT_INC=/usr/include/luajit-2.0
1014

1115
RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
1216
&& CONFIG="\
@@ -54,6 +58,8 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
5458
--with-compat \
5559
--with-file-aio \
5660
--with-http_v2_module \
61+
--add-module=/usr/src/ngx_devel_kit-$DEVEL_KIT_MODULE_VERSION \
62+
--add-module=/usr/src/lua-nginx-module-$LUA_MODULE_VERSION \
5763
" \
5864
&& addgroup -S nginx \
5965
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
@@ -72,15 +78,20 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
7278
gd-dev \
7379
geoip-dev \
7480
perl-dev \
81+
luajit-dev \
7582
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
7683
&& curl -fSL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \
84+
&& curl -fSL https://github.com/simpl/ngx_devel_kit/archive/v$DEVEL_KIT_MODULE_VERSION.tar.gz -o ndk.tar.gz \
85+
&& curl -fSL https://github.com/openresty/lua-nginx-module/archive/v$LUA_MODULE_VERSION.tar.gz -o lua.tar.gz \
7786
&& export GNUPGHOME="$(mktemp -d)" \
7887
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEYS" \
7988
&& gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \
8089
&& rm -r "$GNUPGHOME" nginx.tar.gz.asc \
8190
&& mkdir -p /usr/src \
8291
&& tar -zxC /usr/src -f nginx.tar.gz \
83-
&& rm nginx.tar.gz \
92+
&& tar -zxC /usr/src -f ndk.tar.gz \
93+
&& tar -zxC /usr/src -f lua.tar.gz \
94+
&& rm nginx.tar.gz ndk.tar.gz lua.tar.gz \
8495
&& cd /usr/src/nginx-$NGINX_VERSION \
8596
&& ./configure $CONFIG --with-debug \
8697
&& make -j$(getconf _NPROCESSORS_ONLN) \

docs/versioning.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ The latest tag will always follow the master branch in git. the other versions w
2626
| 1.2.1 | 1.2.1 |1.13.1 | 7.1.6 | 3.4 | 0.2.9 |
2727
| 1.2.2 | 1.2.2 |1.13.2 | 7.1.7 | 3.4 | 0.2.9 |
2828
| 1.2.3 | 1.2.3 |1.13.3 | 7.1.7 | 3.4 | 0.2.9 |
29-
| 1.2.4 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.9 |
30-
| 1.2.5 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.10 |
31-
| 1.2.6 | 1.2.3 |1.13.4 | 7.1.8 | 3.4 | 0.2.11 |
29+
| 1.2.4 | 1.2.4 |1.13.4 | 7.1.8 | 3.4 | 0.2.9 |
30+
| 1.2.5 | 1.2.5 |1.13.4 | 7.1.8 | 3.4 | 0.2.10 |
31+
| 1.2.6 | 1.2.6 |1.13.4 | 7.1.8 | 3.4 | 0.2.11 |
32+
| 1.3.0 | 1.3.0 |1.13.4 | 7.1.8 | 3.4 | 0.3.0 |
3233

3334
These tags will be created as releases on GitHub and as tags in docker hub.
3435

scripts/start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ if [ -f "/var/www/html/composer.lock" ]; then
6969
fi
7070

7171
# Enable custom nginx config files if they exist
72+
if [ -f /var/www/html/conf/nginx/nginx.conf ]; then
73+
cp /var/www/html/conf/nginx/nginx.conf /etc/nginx/nginx.conf
74+
fi
75+
7276
if [ -f /var/www/html/conf/nginx/nginx-site.conf ]; then
7377
cp /var/www/html/conf/nginx/nginx-site.conf /etc/nginx/sites-available/default.conf
7478
fi

0 commit comments

Comments
 (0)