summaryrefslogtreecommitdiffstats
path: root/samples/services/nginx/docker/subservices/server/Dockerfile
blob: 1a87c827630f4b153ac37449869f4098193874ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Copyright (c) Authors of Clover
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0

FROM ubuntu:16.04
LABEL maintainer="Eddie Arrage" maintainer_email="eddie.arrage@huawei.com"
LABEL version="0.2" description="Clover - Nginx HTTP Server"

RUN \
    apt-get update && apt-get install -y \
# Some debug tools in container
    wget \
    libdnet \
    net-tools \
# Packages required to build nginx from source
    build-essential \
    libpcre3-dev \
    libpcre3++-dev \
    libgeoip-dev \
    libxslt-dev \
    git \
# Install required python packages
    python-pip \
&& \
    python -m pip install grpcio redis jinja2 protobuf psutil \
&& \
# Get nginx and module add-on source
    wget https://nginx.org/download/nginx-1.15.0.tar.gz && tar zxvf nginx-1.15.0.tar.gz \
&& \
    wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz && tar xzvf pcre-8.42.tar.gz \
&& \
    wget http://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz \
&& \
    wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz && tar xzvf openssl-1.1.0f.tar.gz \
&& \
    git clone https://github.com/Austinb/nginx-upload-module.git \
&& \
    wget https://github.com/arut/nginx-rtmp-module/archive/v1.2.1.tar.gz && tar xzvf v1.2.1.tar.gz
RUN rm -rf *.tar.gz

# Build supporting modules
ENV  LDFLAGS -fPIC
WORKDIR /pcre-8.42
RUN ./configure
RUN make
RUN make install

WORKDIR /zlib-1.2.11
RUN ./configure
RUN make
RUN make install

WORKDIR /openssl-1.1.0f
RUN ./config
RUN make
RUN make install

WORKDIR /nginx-1.15.0

# Build nginx with all modules in stock Ubuntu 16.04 version
# Add upload and rtmp modules
RUN ./configure \
    --prefix=/usr/share/nginx \
    --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
    --http-scgi-temp-path=/var/lib/nginx/scgi \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --error-log-path=/var/log/nginx/error.log \
    --http-log-path=/var/log/nginx/access.log \
    --pid-path=/run/nginx.pid \
    --lock-path=/var/lock/nginx.lock \
    --with-pcre=../pcre-8.42 \
    --with-pcre-jit \
    --with-ipv6 \
    --with-http_stub_status_module \
    # --with-http_image_filter_module \
    --with-http_xslt_module \
    --with-mail \
    --with-zlib=../zlib-1.2.11 \
    --with-openssl=../openssl-1.1.0f \
    --with-openssl-opt=enable-ec_nistp_64_gcc_128 \
    --with-openssl-opt=no-nextprotoneg \
    --with-openssl-opt=no-weak-ssl-ciphers \
    --with-openssl-opt=no-ssl3 \
    --with-http_ssl_module \
    --with-stream \
    --with-stream_ssl_module \
    --with-threads \
    --with-mail=dynamic \
    --with-mail_ssl_module \
    --http-client-body-temp-path=/var/lib/nginx/body \
    --http-proxy-temp-path=/var/lib/nginx/proxy \
    --with-http_realip_module \
    --with-http_geoip_module \
    --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
    --with-http_v2_module \
    --with-http_sub_module \
    --with-http_addition_module \
    --with-http_dav_module \
    --with-http_auth_request_module \
    --with-http_gunzip_module \
    --with-http_gzip_static_module \
    --with-debug \
    --add-module=../nginx-upload-module \
    --add-module=../nginx-rtmp-module-1.2.1

RUN make
RUN make install

WORKDIR /
RUN mkdir /var/lib/nginx
RUN mkdir /var/www
RUN mkdir /var/www/html

COPY /process /process
COPY /grpc /grpc
CMD ./process/start_process.sh server