Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yano3 committed Jun 12, 2019
1 parent e538e85 commit 5cce927
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM yano3/nginx-ngx_mruby:1.17.0-ngx_mruby2.1.4

ENV NGINX_VERSION=1.17.0
ENV NGX_SMALL_LIGHT_VERSION=0.9.2

RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
git \
curl \
build-essential \
rake \
bison \
libssl-dev \
libpcre3-dev \
zlib1g-dev \
libmagickwand-dev \
\
&& apt-mark manual libmagickwand-6.q16-3 \
&& cd /usr/local/src \
&& git clone --branch v$NGX_SMALL_LIGHT_VERSION --depth 1 https://github.com/cubicdaiya/ngx_small_light.git \
&& curl -s -OL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && tar -xf nginx-$NGINX_VERSION.tar.gz \
\
&& cd /usr/local/src/ngx_small_light \
&& ./setup \
\
&& cd /usr/local/src/nginx-$NGINX_VERSION \
&& ./configure \
--with-compat \
--add-dynamic-module=../ngx_small_light \
&& make modules \
&& cp -p ./objs/*.so /etc/nginx/modules/ \
\
&& cd / \
&& rm -rf /usr/local/src/* \
&& apt-get remove --purge -y \
&& apt-get remove --purge --auto-remove -y \
git \
curl \
build-essential \
rake \
bison \
libssl-dev \
libpcre3-dev \
zlib1g-dev \
libmagickwand-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY nginx.conf /etc/nginx/nginx.conf
36 changes: 36 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

user nginx;
worker_processes 1;

load_module modules/ndk_http_module.so;
load_module modules/ngx_http_mruby_module.so;
load_module modules/ngx_http_small_light_module.so;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 5cce927

Please sign in to comment.