forked from dperson/nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.aarch64
40 lines (34 loc) · 1.65 KB
/
Dockerfile.aarch64
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
FROM arm64v8/nginx:alpine
COPY qemu-aarch64-static /usr/bin/
MAINTAINER David Personette <[email protected]>
# Setup nginx
RUN apk --no-cache --no-progress upgrade && \
apk --no-cache --no-progress add apache2-utils bash curl openssl shadow \
tini tzdata && \
sed -i 's/#gzip/gzip/' /etc/nginx/nginx.conf && \
sed -i "/http_x_forwarded_for\"';/s/';/ '/" /etc/nginx/nginx.conf && \
sed -i "/http_x_forwarded_for/a \\\
'\$request_time \$upstream_response_time';" \
/etc/nginx/nginx.conf && \
echo -e "\n\nstream {\n include /etc/nginx/conf.d/*.stream;\n}" \
>>/etc/nginx/nginx.conf && \
[ -d /srv/www ] || mkdir -p /srv/www && \
{ mv /usr/share/nginx/html/index.html /srv/www/ || :; } && \
apk add --no-cache --no-progress --virtual .gettext gettext && \
mv /usr/bin/envsubst /usr/local/bin/ && \
runDeps="$(scanelf --needed --nobanner /usr/local/bin/envsubst | \
awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' | \
sort -u | xargs -r apk info --installed | sort -u)" && \
apk del --no-cache --no-progress .gettext && \
apk add --no-cache --no-progress $runDeps && \
rm -rf /tmp/* && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
# Forward request and error logs to docker log collector
COPY default.conf /etc/nginx/conf.d/
COPY nginx.sh /usr/bin/
VOLUME ["/srv/www", "/etc/nginx"]
EXPOSE 80 443
HEALTHCHECK --interval=60s --timeout=15s --start-period=120s \
CMD curl -Lk 'https://localhost/index.html'
ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/nginx.sh"]