Skip to content

Commit

Permalink
Fix nginx resty core. Update redis to 5.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Jan 30, 2020
1 parent ce92a9b commit 40c1b42
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Universal docker server
===========================
Nginx, PHP-FPM, MySql, Redis
Nginx (1.17.8), PHP (7.4), MySql (5.7), Redis (5.0.7)

Installation
------------
Expand All @@ -10,13 +10,13 @@ The preferred way to install this extension is through [composer](http:https://getcomp
Either run

```bash
php composer.phar require --prefer-dist matthew-p/docker-server "@dev"
php composer.phar require --prefer-dist matthew-p/docker-server "^4.10.0"
```

or add

```
"matthew-p/docker-server": "@dev"
"matthew-p/docker-server": "^4.10.0"
```

to the require section of your `composer.json` file.
Expand Down Expand Up @@ -62,7 +62,7 @@ to the require section of your `composer.json` file.

## Latest docker images
- NGINX
- matthewpatell/universal-docker-nginx:3.6
- matthewpatell/universal-docker-nginx:3.7
- SERVER
- matthewpatell/universal-docker-server:4.0
- matthewpatell/universal-docker-server:4.0-dev
Expand Down
2 changes: 1 addition & 1 deletion docker/.env-default
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PHP_IDE_CONFIG="serverName=${PROJECT_NAME}"
XDEBUG_CONFIG="default_enable=0 remote_host=172.18.0.1 remote_enable=0 profiler_enable_trigger=0 remote_port=$DEBUG_PORT"

# IMAGES REPOSITORIES
NGINX_REPOSITORY=matthewpatell/universal-docker-nginx:3.6
NGINX_REPOSITORY=matthewpatell/universal-docker-nginx:3.7
SERVER_REPOSITORY=matthewpatell/universal-docker-server:4.0-dev

# For production environment:
Expand Down
37 changes: 32 additions & 5 deletions docker/Dockerfile-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ FROM alpine:3.11

MAINTAINER Matthew Patell <[email protected]>

ENV NGINX_VERSION 1.17.6
ENV NGINX_VERSION 1.17.8

ENV DEVEL_KIT_MODULE_VERSION 0.3.1
ENV LUA_MODULE_VERSION 0.10.15

ENV LUAJIT_LIB=/usr/lib
ENV LUAJIT_INC=/usr/include/luajit-2.1
ENV LUA_RESTY_CORE 0.1.17
ENV LUA_RESTY_LRUCACHE 0.09

ENV LUAJIT_LIB=/usr/local/lib
ENV LUAJIT_INC=/usr/local/include/luajit-2.1
ENV LUAJIT_VERSION 2.1.0-beta3

ENV LUA_REDIS_VERSION 0.27

Expand Down Expand Up @@ -66,6 +70,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& apk add --no-cache --virtual .build-deps \
gcc \
libc-dev \
libgcc \
make \
openssl-dev \
pcre-dev \
Expand All @@ -76,9 +81,16 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
libxslt-dev \
gd-dev \
geoip-dev \
luajit-dev \
perl-dev \
git \
# Install LuaJIT
&& wget -O LuaJIT.tar.gz https://luajit.org/download/LuaJIT-${LUAJIT_VERSION}.tar.gz \
&& tar -xf LuaJIT.tar.gz \
&& rm LuaJIT.tar.gz \
&& cd LuaJIT-${LUAJIT_VERSION} \
&& make \
&& make install \
&& rm -rf LuaJIT-${LUAJIT_VERSION} \
&& curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \
&& curl -fSL https://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 \
Expand Down Expand Up @@ -132,6 +144,21 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \
&& strip /usr/sbin/nginx* \
&& strip /usr/lib/nginx/modules/*.so \
# Install resty core and lrucache
&& cd /tmp \
&& wget -O lua_resty_core.tar.gz https://github.com/openresty/lua-resty-core/archive/v${LUA_RESTY_CORE}.tar.gz \
&& wget -O lua_resty_lrucache.tar.gz https://github.com/openresty/lua-resty-lrucache/archive/v${LUA_RESTY_LRUCACHE}.tar.gz \
&& tar -xf lua_resty_core.tar.gz \
&& tar -xf lua_resty_lrucache.tar.gz \
&& rm lua_resty_core.tar.gz lua_resty_lrucache.tar.gz \
&& cd lua-resty-core-${LUA_RESTY_CORE} \
&& make install \
&& cd /tmp/lua-resty-lrucache-${LUA_RESTY_LRUCACHE} \
&& make install \
&& ln -s /usr/local/lib/lua/resty /usr/local/share/lua/5.1/resty \
&& ln -s /usr/local/lib/lua/ngx /usr/local/share/lua/5.1/ngx \
&& rm -rf /tmp/lua-resty-core-${LUA_RESTY_CORE} \
&& rm -rf /tmp/lua-resty-lrucache-${LUA_RESTY_LRUCACHE} \
&& rm -rf /usr/src/nginx-$NGINX_VERSION \
&& rm -rf /tmp/ngx_brotli \
\
Expand Down Expand Up @@ -167,6 +194,6 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& mkdir /etc/nginx/web \
\
# other packages
&& apk add --no-cache bash
&& apk add --no-cache bash libgcc

CMD /scripts/init-nginx.sh && /scripts/start-nginx.sh && tail -f /var/log/nginx/error.log
4 changes: 2 additions & 2 deletions docker/docker-compose.redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:
redis:
image: redis:4
image: redis:5
hostname: ${REDIS_HOST}
container_name: ${COMPOSE_PROJECT_NAME}_redis
command: ["redis-server", "/usr/local/etc/redis/redis.conf", "--requirepass", "${REDIS_PASSWORD}"]
Expand All @@ -15,4 +15,4 @@ services:
networks:
common:
aliases:
- ${REDIS_HOST}
- ${REDIS_HOST}
2 changes: 1 addition & 1 deletion docs/ENVIRONMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Property | Values | Description
## <a id="images-envs"></a>Images env (service: all)
Property | Values | Description
---------|--------|------------
`NGINX_REPOSITORY`| `(string)` `Default: matthewpatell/universal-docker-nginx:3.6` | Nginx docker image
`NGINX_REPOSITORY`| `(string)` `Default: matthewpatell/universal-docker-nginx:3.7` | Nginx docker image
`SERVER_REPOSITORY`| `(string)` `Default: matthewpatell/universal-docker-server:4.0-dev` | Either server (or server dev) image in non-scalable configuration, or `matthewpatell/universal-docker-server-php-fpm` for scaling `nginx`+`php-fpm`.
`TERMINAL_REPOSITORY`| `(string)` `Default: none` | Static non-scalable docker image for ssh connection, cron, queue listener and etc. Use image: `matthewpatell/universal-docker-server`.

Expand Down

0 comments on commit 40c1b42

Please sign in to comment.