-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Dockerfile
37 lines (25 loc) · 921 Bytes
/
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
FROM nginx:1.22-alpine
MAINTAINER Mark Shust <[email protected]>
ARG APP_ID=1000
RUN addgroup -g "$APP_ID" app \
&& adduser -G app -u "$APP_ID" -h /var/www -s /bin/bash -S app
RUN touch /var/run/nginx.pid
RUN mkdir /sock
RUN apk add --no-cache \
curl \
nss-tools \
openssl
RUN mkdir /etc/nginx/certs \
&& echo -e "\n\n\n\n\n\n\n" | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/certs/nginx.key -out /etc/nginx/certs/nginx.crt
ARG TARGETARCH
RUN cd /usr/local/bin/ \
&& curl -L https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-$TARGETARCH -o mkcert \
&& chmod +x mkcert
COPY ./conf/nginx.conf /etc/nginx/
COPY ./conf/default.conf /etc/nginx/conf.d/
RUN mkdir -p /etc/nginx/html /var/www/html \
&& chown -R app:app /etc/nginx /var/www /var/cache/nginx /var/run/nginx.pid /sock
EXPOSE 8443
USER app:app
VOLUME /var/www
WORKDIR /var/www/html