summaryrefslogtreecommitdiff
path: root/build/nginx/Dockerfile
blob: f74d55525d2a900d505b50059aa07c242b25d12f (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
FROM alpine:latest

# 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 +x /usr/local/bin/entrypoint

# do the
USER nginx
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/entrypoint"]