Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +26 -3
Dockerfile
CHANGED
@@ -1,15 +1,38 @@
|
|
1 |
# Use the official NGINX image
|
2 |
FROM nginx:latest
|
3 |
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
# Copy custom config
|
8 |
COPY nginx.conf /etc/nginx/nginx.conf
|
9 |
|
10 |
# Copy static HTML content
|
11 |
COPY html /usr/share/nginx/html
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
WORKDIR $HOME
|
14 |
|
15 |
COPY --chown=user:user --chmod=755 entrypoint.sh $HOME
|
|
|
1 |
# Use the official NGINX image
|
2 |
FROM nginx:latest
|
3 |
|
4 |
+
#=================================================================
|
5 |
+
USER root
|
6 |
+
#=================================================================
|
7 |
+
RUN groupadd user && \
|
8 |
+
useradd -d /home/user -ms /bin/bash -g user -G user -p user user
|
9 |
+
|
10 |
+
RUN apt update -y && \
|
11 |
+
apt upgrade -y && \
|
12 |
+
apt install -yq nginx-full && \
|
13 |
+
apt clean && \
|
14 |
+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
15 |
|
|
|
16 |
COPY nginx.conf /etc/nginx/nginx.conf
|
17 |
|
18 |
# Copy static HTML content
|
19 |
COPY html /usr/share/nginx/html
|
20 |
|
21 |
+
RUN mkdir -p /var/cache/nginx \
|
22 |
+
/var/log/nginx \
|
23 |
+
/var/lib/nginx && \
|
24 |
+
touch /var/run/nginx.pid && \
|
25 |
+
chown -R user:user /var/cache/nginx \
|
26 |
+
/var/log/nginx \
|
27 |
+
/var/lib/nginx \
|
28 |
+
/var/run/nginx.pid
|
29 |
+
|
30 |
+
#=================================================================
|
31 |
+
USER user
|
32 |
+
#=================================================================
|
33 |
+
ENV HOME=/home/user \
|
34 |
+
PATH=/home/user/.local/bin:$PATH
|
35 |
+
|
36 |
WORKDIR $HOME
|
37 |
|
38 |
COPY --chown=user:user --chmod=755 entrypoint.sh $HOME
|