forked from rgordeev/nginx-ts-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (43 loc) · 1.32 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
FROM 2chat/ubuntu:xenial
ENV DEBIAN_FRONTEND noninteractive
ENV PATH $PATH:/usr/local/nginx/sbin
ENV NGINX_VERSION 1.13.3
ENV NGINX_TS_VERSION 0.1.1
EXPOSE 8080
EXPOSE 0-65535/udp
# create directories
RUN mkdir /src /config /logs /data
# update and upgrade packages
RUN set -x && \
apt-get update && \
apt-get upgrade -y && \
apt-get clean && \
apt-get install -y --no-install-recommends build-essential \
wget software-properties-common && \
# nginx dependencies
apt-get install -y --no-install-recommends libpcre3-dev \
zlib1g-dev libssl-dev wget
# get nginx source
WORKDIR /src
RUN set -x && \
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar zxf nginx-${NGINX_VERSION}.tar.gz && \
rm nginx-${NGINX_VERSION}.tar.gz && \
# get nginx-rtmp module
wget https://github.com/arut/nginx-ts-module/archive/v${NGINX_TS_VERSION}.tar.gz && \
tar zxf v${NGINX_TS_VERSION}.tar.gz && \
rm v${NGINX_TS_VERSION}.tar.gz
# compile nginx
WORKDIR /src/nginx-${NGINX_VERSION}
RUN set -x && \
./configure --with-http_ssl_module \
--add-module=/src/nginx-ts-module-${NGINX_TS_VERSION} \
--with-http_stub_status_module \
--conf-path=/config/nginx.conf \
--error-log-path=/logs/error.log \
--http-log-path=/logs/access.log && \
make && \
make install
COPY nginx.conf /config/
WORKDIR /
CMD "nginx"