-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine
87 lines (80 loc) · 3.07 KB
/
Dockerfile.alpine
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
FROM alpine:3.6
MAINTAINER "Ming-Jui Chen" <[email protected]>
WORKDIR /tmp
ENV NGINX_VERSION=1.13.3 \
NGINX_RTMP_MODULE_VERSION=1.2.0
RUN buildDeps="make \
gcc \
libc-dev \
openssl-dev \
pcre-dev \
zlib-dev \
linux-headers \
curl \
gnupg \
wget \
libxslt-dev \
gd-dev \
geoip-dev " \
&& export MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" \
&& apk update \
&& apk add --no-cache --virtual .build-deps ${buildDeps} \
&& addgroup -S nginx \
&& adduser -D -S -h /var/cache/nginx -s /sbin/ash -G nginx nginx \
&& echo "Build Nginx & RTMP module" \
&& wget -O nginx-${NGINX_VERSION}.tar.gz https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
&& tar -zxf nginx-${NGINX_VERSION}.tar.gz \
&& wget -O nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}.tar.gz https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_MODULE_VERSION}.tar.gz \
&& tar -zxf nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION}.tar.gz \
&& cd nginx-${NGINX_VERSION} \
&& ./configure \
--user=nginx \
--group=nginx \
--add-module=../nginx-rtmp-module-${NGINX_RTMP_MODULE_VERSION} \
--with-http_ssl_module \
--with-http_xslt_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-http_dav_module \
--with-http_auth_request_module \
--with-mail \
--with-mail_ssl_module \
--with-file-aio \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-http_slice_module \
--with-http_v2_module \
&& make ${MAKEFLAGS} && make install \
&& echo "Cleanup" \
&& apk add --no-cache --virtual .gettext gettext \
&& mv /usr/bin/envsubst /tmp/ \
&& runDeps="$( \
scanelf --needed --nobanner \
/usr/local/nginx/sbin/nginx \
/usr/local/nginx/modules/*.so \
/tmp/envsubst \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
) supervisor " \
&& apk add --no-cache --virtual .nginx-rundeps $runDeps \
&& apk del .build-deps \
&& apk del .gettext \
&& mv /tmp/envsubst /usr/local/bin/ \
&& rm -rf /var/cache/apk/* /tmp/*
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY static/crossdomain.xml /usr/local/nginx/html/
COPY static/stat.xsl /usr/local/nginx/html/
EXPOSE 1935 80 443
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]