#Use Dockerfile file content
FROM imocence/alpine:3.15
WORKDIR /opt
COPY entrypoint.sh /usr/local/openresty/
RUN wget -c 'http://openresty.org/package/[email protected]' -O /etc/apk/keys/[email protected] \
&& . /etc/os-release && MAJOR_VER=`echo $VERSION_ID | sed 's/\.[0-9]\+$//'` \
&& echo "http://openresty.org/package/alpine/v$MAJOR_VER/main" >> /etc/apk/repositories && apk add --no-cache openresty \
&& mkdir -p /usr/local/openresty/nginx/conf.d && sed -i "s!#gzip!gzip!g" /usr/local/openresty/nginx/conf/nginx.conf \
&& sed -i '24i\\n include /usr/local/openresty/nginx/conf.d/*.conf;' /usr/local/openresty/nginx/conf/nginx.conf \
&& chmod +x /usr/local/openresty/entrypoint.sh && rm -rf /tmp/* /var/cache/apk/* && mkdir -p /var/log/nginx/
ENV PATH="$PATH:/usr/local/openresty/bin" LUA_VER="0.1.27" LRUCACHE="0.11"
RUN wget -c https://github.com/unixhot/waf/archive/refs/tags/v1.0.1.tar.gz -O /opt/waf.tar.gz \
&& wget -c https://github.com/openresty/lua-resty-core/archive/refs/tags/v$LUA_VER.tar.gz -O /opt/lua-resty-core.tar.gz \
&& wget -c https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v$LRUCACHE.tar.gz -O /opt/lua-resty-lrucache.tar.gz \
&& cd /opt && tar -zxf /opt/waf.tar.gz && tar -zxf /opt/lua-resty-core.tar.gz && tar -zxf /opt/lua-resty-lrucache.tar.gz \
&& mv lua-resty-lrucache-$LRUCACHE/lib/resty /opt/waf-1.0.1/waf/ \
&& mv lua-resty-core-$LUA_VER/lib/resty/* /opt/waf-1.0.1/waf/resty/ \
&& mv /opt/waf-1.0.1/waf /usr/local/openresty/nginx/conf/ \
&& sed -i "s!57459267!xxxxxxxx!g" /usr/local/openresty/nginx/conf/waf/config.lua \
&& sed -i '26i\\n lua_shared_dict limit 10m;' /usr/local/openresty/nginx/conf/nginx.conf \
&& sed -i '26i\ lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua";' /usr/local/openresty/nginx/conf/nginx.conf \
&& sed -i '26i\ init_by_lua_file "/usr/local/openresty/nginx/conf/waf/init.lua";' /usr/local/openresty/nginx/conf/nginx.conf \
&& sed -i '26i\ access_by_lua_file "/usr/local/openresty/nginx/conf/waf/access.lua";' /usr/local/openresty/nginx/conf/nginx.conf \
&& rm -rf /opt/*.tar.gz /opt/waf-* /opt/lua-resty-*
EXPOSE 80
VOLUME ["/opt/conf.d", "/opt/html", "/opt/logs"]
ENTRYPOINT ["/usr/local/openresty/entrypoint.sh"]
#Use docker-compose.yml file content
version: '2'
services:
web:
image: imocence/openresty:v1.21.4.2
container_name: resty
network_mode: bridge
ports:
- "0.0.0.0:9191:80"
volumes:
- ./conf.d/:/opt/conf.d/
- ./html/:/opt/html/
- ./logs/:/opt/logs/
restart: unless-stopped
Content type
Image
Digest
sha256:12034d074…
Size
7.1 MB
Last updated
almost 3 years ago
docker pull imocence/openresty