-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathDockerfile.nginx
27 lines (20 loc) · 946 Bytes
/
Dockerfile.nginx
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
# syntax=docker/dockerfile:1.14
FROM nginx:1.27.4-alpine-otel
ARG NJS_DIR
ARG NGINX_CONF_DIR
ARG BUILD_AGENT
RUN apk add --no-cache libcap \
&& mkdir -p /usr/lib/nginx/modules \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap -v 'cap_net_bind_service=+ep' /usr/sbin/nginx \
&& setcap 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& setcap -v 'cap_net_bind_service=+ep' /usr/sbin/nginx-debug \
&& apk del libcap
COPY ${NJS_DIR}/httpmatches.js /usr/lib/nginx/modules/njs/httpmatches.js
COPY ${NGINX_CONF_DIR}/nginx.conf /etc/nginx/nginx.conf
COPY ${NGINX_CONF_DIR}/grpc-error-locations.conf /etc/nginx/grpc-error-locations.conf
COPY ${NGINX_CONF_DIR}/grpc-error-pages.conf /etc/nginx/grpc-error-pages.conf
RUN chown -R 101:1001 /etc/nginx /var/cache/nginx
LABEL org.nginx.ngf.image.build.agent="${BUILD_AGENT}"
USER 101:1001
CMD ["sh", "-c", "rm -rf /var/run/nginx/*.sock && nginx -g 'daemon off;'"]