-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
52 lines (43 loc) · 1.64 KB
/
Dockerfile
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
ARG NGINX_VERSION=1.19.3
ARG NGINX_RTMP_VERSION=1.2.1
FROM alpine:3.12 AS build
ARG NGINX_VERSION
ARG NGINX_RTMP_VERSION
COPY nginx-rtmp-fallthrough-fix.patch /tmp/nginx-rtmp-fallthrough-fix.patch
RUN \
build_pkgs="build-base linux-headers openssl-dev pcre-dev wget zlib-dev patch" && \
apk --no-cache add ${build_pkgs} ${runtime_pkgs} && \
cd /tmp && \
wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz && \
tar xzf nginx-${NGINX_VERSION}.tar.gz && \
tar xzf v${NGINX_RTMP_VERSION}.tar.gz && \
patch nginx-rtmp-module-${NGINX_RTMP_VERSION}/ngx_rtmp_eval.c /tmp/nginx-rtmp-fallthrough-fix.patch && \
cd /tmp/nginx-${NGINX_VERSION} && \
./configure \
--prefix=/etc/nginx \
--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=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--add-module=../nginx-rtmp-module-${NGINX_RTMP_VERSION} \
--with-http_ssl_module && \
make && \
make install && \
rm -rf /tmp/* && \
apk del ${build_pkgs} && \
rm -rf /var/cache/apk/*
FROM alpine:3.12
LABEL MAINTAINER Elias Menon <[email protected]>
COPY --from=build /usr/sbin/nginx /usr/sbin/nginx
COPY --from=build /etc/nginx /etc/nginx
COPY nginx.conf /etc/nginx/nginx.conf
RUN \
apk add --no-cache ca-certificates openssl pcre zlib tzdata git && \
mkdir /var/log/nginx && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 1935
CMD ["nginx"]