Spaces:
Sleeping
Sleeping
hekod19045
commited on
Update Dockerfile
Browse files- Dockerfile +13 -6
Dockerfile
CHANGED
@@ -4,13 +4,20 @@ FROM docker.io/searxng/searxng:latest
|
|
4 |
# Switch to root user to adjust permissions
|
5 |
USER root
|
6 |
|
7 |
-
# Change ownership to root and set permissions
|
8 |
-
# Adjust these as per your security requirements
|
9 |
-
RUN chmod -R 777 /
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Expose the port that SearxNG listens on
|
16 |
EXPOSE 8080
|
|
|
4 |
# Switch to root user to adjust permissions
|
5 |
USER root
|
6 |
|
|
|
|
|
|
|
7 |
|
8 |
+
# Define directories to exclude from chmod
|
9 |
+
ENV EXCLUDE_DIRS="/dev /proc /sys /etc /run /var/lib/docker /var/run /usr /tmp /var/tmp /mnt /media"
|
10 |
+
|
11 |
+
# Apply chmod 777 recursively, excluding specified directories
|
12 |
+
RUN for DIR in $EXCLUDE_DIRS; do \
|
13 |
+
echo "Excluding $DIR from chmod"; \
|
14 |
+
done && \
|
15 |
+
find / \
|
16 |
+
$(printf "! -path %s/* " $EXCLUDE_DIRS) \
|
17 |
+
-a ! $(printf "! -path %s" $EXCLUDE_DIRS | paste -sd " -o " -) \
|
18 |
+
-exec chmod 777 {} \; || true
|
19 |
+
|
20 |
+
|
21 |
|
22 |
# Expose the port that SearxNG listens on
|
23 |
EXPOSE 8080
|