diff options
-rw-r--r-- | Dockerfile | 29 | ||||
-rw-r--r-- | circle.yml | 25 | ||||
-rw-r--r-- | nginx.conf | 4 |
3 files changed, 29 insertions, 29 deletions
@@ -9,25 +9,27 @@ RUN \ | |||
9 | apt-get install -y -qq git wget build-essential zlib1g-dev libpcre3-dev git gcc g++ make && \ | 9 | apt-get install -y -qq git wget build-essential zlib1g-dev libpcre3-dev git gcc g++ make && \ |
10 | rm -rf /var/lib/apt/lists/* | 10 | rm -rf /var/lib/apt/lists/* |
11 | 11 | ||
12 | ENV NGINX_VERSION=1.11.9 PCRE_VERSION=8.40 OPENSSL_VERSION=1.1.0e ZLIB_VERSION=1.2.11 | ||
13 | |||
12 | # Get Source Code | 14 | # Get Source Code |
13 | RUN \ | 15 | RUN \ |
14 | wget "http://nginx.org/download/nginx-1.11.9.tar.gz" && \ | 16 | wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" && \ |
15 | wget "http://linux.stanford.edu/pub/exim/pcre/pcre-8.40.tar.gz" && \ | 17 | wget "http://linux.stanford.edu/pub/exim/pcre/pcre-${PCRE_VERSION}.tar.gz" && \ |
16 | wget "https://www.openssl.org/source/openssl-1.1.0e.tar.gz" && \ | 18 | wget "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" && \ |
17 | wget "http://zlib.net/zlib-1.2.11.tar.gz" && \ | 19 | wget "http://zlib.net/zlib-${ZLIB_VERSION}.tar.gz" && \ |
18 | git clone https://github.com/cuber/ngx_http_google_filter_module && \ | 20 | git clone https://github.com/cuber/ngx_http_google_filter_module && \ |
19 | git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module && \ | 21 | git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module && \ |
20 | tar xzf nginx-1.11.9.tar.gz && \ | 22 | tar xzf nginx-${NGINX_VERSION}.tar.gz && \ |
21 | tar xzf pcre-8.40.tar.gz && \ | 23 | tar xzf pcre-${PCRE_VERSION}.tar.gz && \ |
22 | tar xzf openssl-1.1.0e.tar.gz && \ | 24 | tar xzf openssl-${OPENSSL_VERSION}.tar.gz && \ |
23 | tar xzf zlib-1.2.11.tar.gz | 25 | tar xzf zlib-${ZLIB_VERSION}.tar.gz |
24 | 26 | ||
25 | ADD ./nginx.service /etc/init.d/nginx | 27 | ADD ./nginx.service /etc/init.d/nginx |
26 | ADD ./nginx.conf /etc/nginx/nginx.conf | 28 | ADD ./nginx.conf /etc/nginx/nginx.conf |
27 | 29 | ||
28 | # Install Nginx | 30 | # Install Nginx |
29 | RUN \ | 31 | RUN \ |
30 | cd nginx-1.11.9 && \ | 32 | cd nginx-${NGINX_VERSION} && \ |
31 | ./configure --prefix=/etc/nginx \ | 33 | ./configure --prefix=/etc/nginx \ |
32 | --sbin-path=/usr/sbin/nginx \ | 34 | --sbin-path=/usr/sbin/nginx \ |
33 | --conf-path=/etc/nginx/nginx.conf \ | 35 | --conf-path=/etc/nginx/nginx.conf \ |
@@ -64,9 +66,9 @@ RUN \ | |||
64 | --with-file-aio \ | 66 | --with-file-aio \ |
65 | --with-http_v2_module \ | 67 | --with-http_v2_module \ |
66 | --with-ipv6 \ | 68 | --with-ipv6 \ |
67 | --with-pcre=../pcre-8.40 \ | 69 | --with-pcre=../pcre-${PCRE_VERSION} \ |
68 | --with-openssl=../openssl-1.1.0e \ | 70 | --with-openssl=../openssl-${OPENSSL_VERSION} \ |
69 | --with-zlib=../zlib-1.2.11 \ | 71 | --with-zlib=../zlib-${ZLIB_VERSION} \ |
70 | --add-module=../ngx_http_google_filter_module \ | 72 | --add-module=../ngx_http_google_filter_module \ |
71 | --add-module=../ngx_http_substitutions_filter_module && \ | 73 | --add-module=../ngx_http_substitutions_filter_module && \ |
72 | make -j4 && \ | 74 | make -j4 && \ |
@@ -78,7 +80,6 @@ RUN \ | |||
78 | mkdir -p /var/cache/nginx | 80 | mkdir -p /var/cache/nginx |
79 | 81 | ||
80 | EXPOSE 80 | 82 | EXPOSE 80 |
81 | EXPOSE 443 | ||
82 | 83 | ||
83 | # Run Nginx | 84 | # Run Nginx |
84 | CMD service nginx start && tail -F /var/log/nginx/access.log | 85 | CMD ["nginx", "-g", "daemon off;"] |
@@ -1,13 +1,12 @@ | |||
1 | machine: | 1 | machine: |
2 | services: | 2 | services: |
3 | - docker | 3 | - docker |
4 | 4 | ||
5 | dependencies: | 5 | dependencies: |
6 | override: | 6 | override: |
7 | - docker info | 7 | - docker info |
8 | - docker build -t nginx-proxy-google . | 8 | - docker build -t nginx-proxy-google . |
9 | 9 | ||
10 | test: | 10 | test: |
11 | override: | 11 | override: |
12 | - docker run -d -p 8080:80 nginx-proxy-google; sleep 10 | 12 | - docker run -d -p 8080:80 nginx-proxy-google; sleep 10 |
13 | |||
@@ -1,5 +1,5 @@ | |||
1 | user nginx; | 1 | user nginx; |
2 | worker_processes 1; | 2 | worker_processes auto; |
3 | 3 | ||
4 | events { | 4 | events { |
5 | worker_connections 1024; | 5 | worker_connections 1024; |
@@ -28,4 +28,4 @@ http { | |||
28 | root html; | 28 | root html; |
29 | } | 29 | } |
30 | } | 30 | } |
31 | } \ No newline at end of file | 31 | } |