-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (22 loc) · 982 Bytes
/
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
FROM alpine:latest AS build
ENV NGINX_VERSION=1.19.2
RUN apk add --no-cache g++ pcre-dev zlib-dev make git
# nginx
RUN wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && tar xzvf nginx-${NGINX_VERSION}.tar.gz && rm -rf *.tar.gz
# nginx-push-stream-module latest
RUN git clone https://github.com/wandenberg/nginx-push-stream-module.git
WORKDIR /nginx-${NGINX_VERSION}
# configure and build
RUN ./configure --add-module=../nginx-push-stream-module --with-http_auth_request_module && make && make install
FROM alpine:latest
ENV PUBSUB_SECRET=${PUBSUB_SECRET:-""}
COPY --from=build /usr/local/nginx /usr/local/nginx
COPY nginx.conf.template /usr/local/nginx/conf/
COPY set-env-in-nginx-config.sh /
RUN chmod +x /set-env-in-nginx-config.sh
COPY sysctl.conf /etc/sysctl.conf
COPY limits.conf /etc/security/
RUN apk update && \
apk add zlib pcre gettext
CMD ["/bin/sh", "-c", "/set-env-in-nginx-config.sh && /usr/local/nginx/sbin/nginx"]
EXPOSE 80/tcp 443/tcp