-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (27 loc) · 1 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
ARG DOTNET_VERSION
FROM mcr.microsoft.com/dotnet/aspnet:$DOTNET_VERSION as builder
WORKDIR /root/
COPY ./build_ngx_brotli.sh ./
RUN bash ./build_ngx_brotli.sh
FROM mcr.microsoft.com/dotnet/aspnet:$DOTNET_VERSION
RUN apt-get update \
&& apt-get -y install nginx gettext \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --gid 1000 wwwdata \
&& useradd -m -r -s /usr/sbin/nologin --uid 1000 -g wwwdata wwwdata \
&& mkdir /run/nginx \
&& chown -R wwwdata:wwwdata /run/nginx \
&& chown -R wwwdata:wwwdata /var/log/nginx \
&& chown -R wwwdata:wwwdata /var/lib/nginx \
&& chown -R root:wwwdata /etc/nginx/conf.d \
&& chmod g+w /etc/nginx/conf.d \
&& mkdir /srv/www \
&& mkdir /srv/dotnet \
&& mkdir /data \
&& chown -R root:wwwdata /srv/www \
&& chown -R root:wwwdata /srv/dotnet \
&& chown -R wwwdata:wwwdata /data
COPY --from=builder /root/nginx-src/objs/*.so /usr/lib/nginx/modules/
COPY ./brotli.conf /etc/nginx/modules-enabled/
COPY ./nginx.conf ./ssl.conf /etc/nginx/