11ARG  NGINX_VERSION=1.21.6
22ARG  NGINX_HTTP_FLV_MODULE=1.2.10
3+ ARG  HTTP_PORT=80
4+ ARG  HTTPS_PORT=443
5+ ARG  RTMP_PORT=1935
6+ ARG  HTTP_FLV_MODULE=9000
37
48# ##################################################
59#  Build this NGINX-build image.
610FROM  alpine:3.15.3 as build-nginx
711ARG  NGINX_VERSION
812ARG  NGINX_HTTP_FLV_MODULE
913
10- WORKDIR  /tmp 
14+ WORKDIR  /workspace 
1115
1216#  Get nginx and Get nginx-http-flv-module
1317RUN  sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'  /etc/apk/repositories\
@@ -19,12 +23,12 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
1923 && tar -zxvf v${NGINX_HTTP_FLV_MODULE}.tar.gz\
2024 && rm v${NGINX_HTTP_FLV_MODULE}.tar.gz
2125
22- WORKDIR  /tmp /nginx-${NGINX_VERSION}
26+ WORKDIR  /workspace /nginx-${NGINX_VERSION}
2327
2428RUN  \
2529 ./configure \
2630 --prefix=/usr/local/nginx \
27-  --add-module=/tmp /nginx-http-flv-module-${NGINX_HTTP_FLV_MODULE} \
31+  --add-module=/workspace /nginx-http-flv-module-${NGINX_HTTP_FLV_MODULE} \
2832 --conf-path=/etc/nginx/nginx.conf \
2933 --with-threads \
3034 --with-http_ssl_module \
@@ -38,13 +42,17 @@ RUN \
3842#  Build the release image.
3943FROM  alpine:3.15.3
4044
41- ENV  HTTP_PORT 80 
42- #  ENV  HTTPS_PORT 443 
43- ENV  RTMP_PORT 1935 
44- ENV  HTTP_FLV_MODULE 9000 
45+ ARG  HTTP_PORT
46+ ARG HTTPS_PORT
47+ ARG  RTMP_PORT
48+ ARG  HTTP_FLV_MODULE
4549
46- RUN  sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'  /etc/apk/repositories\
47- 	&& apk add --no-cache pcre-dev zlib-dev openssl openssl-dev gettext
50+ ENV  HTTP_PORT ${HTTP_PORT}
51+ ENV  HTTPS_PORT ${HTTPS_PORT}
52+ ENV  RTMP_PORT ${RTMP_PORT}
53+ ENV  HTTP_FLV_MODULE ${HTTP_FLV_MODULE}
54+ 55+ RUN  apk add --no-cache pcre-dev zlib-dev openssl openssl-dev gettext
4856
4957COPY  --from=build-nginx /usr/local/nginx /usr/local/nginx
5058COPY  --from=build-nginx /etc/nginx /etc/nginx
@@ -55,8 +63,9 @@ COPY nginx.conf /etc/nginx/nginx.conf
5563RUN  mkdir -p /opt/data && mkdir /www
5664#  COPY static /www/static
5765
58- EXPOSE  9000
59- EXPOSE  1935
6066EXPOSE  80
67+ EXPOSE  443
68+ EXPOSE  1935
69+ EXPOSE  9000
6170
6271CMD  ["nginx" , "-g" , "daemon off;" ]
0 commit comments