-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
76 lines (58 loc) · 1.82 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# builder
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION:-3.20} AS builder
ARG NGINX_VERSION
RUN apk add --no-cache --update \
build-base \
wget \
zlib-dev \
zlib-static
RUN mkdir -p /build && \
cd /build && \
wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxvf nginx-${NGINX_VERSION}.tar.gz
WORKDIR /build/nginx-${NGINX_VERSION}
RUN ./configure \
--error-log-path=/dev/stderr \
--http-log-path=/dev/stdout \
--with-cc-opt="-O2" \
--with-ld-opt="-s -static" \
--without-http_access_module \
--without-http_auth_basic_module \
--without-http_autoindex_module \
--without-http_browser_module \
--without-http_empty_gif_module \
--without-http_fastcgi_module \
--without-http_geo_module \
--without-http_grpc_module \
--without-http_limit_conn_module \
--without-http_limit_req_module \
--without-http_map_module \
--without-http_memcached_module \
--without-http_mirror_module \
--without-http_proxy_module \
--without-http_rewrite_module \
--without-http_scgi_module \
--without-http_split_clients_module \
--without-http_upstream_hash_module \
--without-http_upstream_ip_hash_module \
--without-http_upstream_keepalive_module \
--without-http_upstream_least_conn_module \
--without-http_upstream_zone_module \
--without-http_userid_module \
--without-http_uwsgi_module \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
&& strip /usr/local/nginx/sbin/nginx
RUN addgroup -S nginx && adduser -S -G nginx nginx
RUN chown -R nginx /usr/local/nginx/html
# release
FROM scratch
LABEL maintainer="Scott Mathieson <scott@eingress.io>"
COPY --from=builder /usr/local/nginx /usr/local/nginx
COPY --from=builder /etc/passwd /etc/group /etc/
COPY nginx.conf /usr/local/nginx/conf/
STOPSIGNAL SIGQUIT
EXPOSE 80
ENTRYPOINT ["/usr/local/nginx/sbin/nginx"]
CMD ["-g", "daemon off;"]