forked from firecat53/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (31 loc) · 1.04 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
FROM alpine:3.13
LABEL "Maintainer"="Scott Hansen <[email protected]>"
RUN \
# Install dependencies
apk add --no-cache nginx && \
# Remove (some of the) default nginx config
rm -f /etc/nginx.conf && \
rm -f /etc/nginx/conf.d/default.conf && \
rm -rf /etc/nginx/sites-* && \
rm -rf /var/log/nginx && \
rm -rf /var/www/* && \
# Ensure nginx logs, even if the config has errors, are written to stderr
rm /var/lib/nginx/logs && \
mkdir -p /var/lib/nginx/logs && \
ln -s /dev/stderr /var/lib/nginx/logs/error.log && \
chown -R nobody:www-data /var/lib/nginx/ /var/log/ && \
chmod o+x /var/lib/nginx && \
# Create folder where the user hook into our default configs
mkdir -p /etc/nginx/server.d/ && \
mkdir -p /etc/nginx/location.d/ && \
# Create default nginx.pid location
mkdir -p /run/nginx && \
chown nobody:www-data /run/nginx
WORKDIR /var/www
ADD etc/ /etc/
USER nobody
VOLUME ["/run/nginx", \
"/var/log/nginx", \
"/var/lib/nginx/tmp"]
EXPOSE 8080
ENTRYPOINT ["/usr/sbin/nginx"]