blob: e78dd021654a054a253a3df660407c935b7fc1c8 (
plain)
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
|
ARG ALPINE_VERSION="3.23"
FROM alpine:${ALPINE_VERSION}
# install packages
RUN apk add --no-cache nginx shadow curl tini
RUN rm -fr /var/cache/apk/*
# update nginx user
RUN groupmod --gid 1000 nginx
RUN usermod --uid 1000 nginx
# remove build packages
RUN apk del shadow
# make log syms
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
# copy configs
RUN mkdir -p /etc/nginx
COPY ./*.conf /etc/nginx/
RUN chown -R nginx:nginx /etc/nginx
# copy entrypoint
COPY ./entrypoint.sh /usr/local/bin/entrypoint
RUN chmod +rx /usr/local/bin/entrypoint
# do the
USER nginx
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/entrypoint"]
|