Spaces:
Running
Running
BinaryONe
commited on
Commit
·
9b4ebe2
1
Parent(s):
3839714
Nginx Changes
Browse files- Dockerfile +7 -13
Dockerfile
CHANGED
@@ -4,15 +4,17 @@ FROM alpine:latest
|
|
4 |
RUN apk update && apk upgrade && \
|
5 |
apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates openrc
|
6 |
|
7 |
-
# Create the softlevel file (CRUCIAL FIX)
|
8 |
-
RUN touch /run/openrc/softlevel
|
9 |
# Create a group and user
|
10 |
#RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
11 |
RUN adduser -D -g 'user' user
|
12 |
|
13 |
-
#
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
|
17 |
# Set working directory
|
18 |
WORKDIR /app
|
@@ -39,14 +41,6 @@ COPY nginx.conf /etc/nginx/nginx.conf
|
|
39 |
RUN cat /etc/nginx/nginx.conf && echo "--------------------"
|
40 |
# && cat /etc/nginx/conf.d/default.conf
|
41 |
|
42 |
-
# Create necessary directories and set correct permissions (fix ownership)
|
43 |
-
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx && \
|
44 |
-
chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
|
45 |
-
chown -R user:user /app /var/www/html /var/lib/nginx && chmod -R 777 /app
|
46 |
-
|
47 |
-
# Remove the user directive from the main nginx.conf (not needed)
|
48 |
-
#RUN sed -i '/^user /d' /etc/nginx/nginx.conf
|
49 |
-
|
50 |
# Switch to non-root user
|
51 |
USER user
|
52 |
|
|
|
4 |
RUN apk update && apk upgrade && \
|
5 |
apk add --no-cache nginx python3 python3-dev py3-pip build-base libffi-dev openssl-dev shadow gcc musl-dev ca-certificates openrc
|
6 |
|
|
|
|
|
7 |
# Create a group and user
|
8 |
#RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
9 |
RUN adduser -D -g 'user' user
|
10 |
|
11 |
+
# Create necessary directories and set correct permissions (fix ownership)
|
12 |
+
RUN mkdir -p /var/www/html /var/log/nginx /run/nginx /run/openrc && \
|
13 |
+
chown -R nginx:nginx /var/lib/nginx /var/log/nginx /run/nginx && \
|
14 |
+
chown -R user:user /app /var/www/html /var/lib/nginx && chmod -R 777 /app
|
15 |
+
|
16 |
+
# Create the softlevel file (CRUCIAL FIX)
|
17 |
+
RUN touch /run/openrc/softlevel
|
18 |
|
19 |
# Set working directory
|
20 |
WORKDIR /app
|
|
|
41 |
RUN cat /etc/nginx/nginx.conf && echo "--------------------"
|
42 |
# && cat /etc/nginx/conf.d/default.conf
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
# Switch to non-root user
|
45 |
USER user
|
46 |
|