Update Dockerfile
Browse files- Dockerfile +14 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,20 @@
|
|
| 1 |
# Start from the official NyaProxy image
|
| 2 |
FROM k3scat/nya-proxy:latest
|
| 3 |
|
| 4 |
-
# Switch to the root user
|
| 5 |
USER root
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Start from the official NyaProxy image
|
| 2 |
FROM k3scat/nya-proxy:latest
|
| 3 |
|
| 4 |
+
# Switch to the root user to create a new directory
|
| 5 |
USER root
|
| 6 |
|
| 7 |
+
# Create a new directory named /data.
|
| 8 |
+
# The `chmod 777` command gives read and write permissions to *any* user.
|
| 9 |
+
# This ensures that the user running the container on Hugging Face's platform
|
| 10 |
+
# will have the necessary permissions.
|
| 11 |
+
RUN mkdir /data && chmod 777 /data
|
| 12 |
|
| 13 |
+
# The NyaProxy application can be configured using the NYA_PROXY_CONFIG_PATH
|
| 14 |
+
# environment variable. We set it here to point to a file in our new writable directory.
|
| 15 |
+
ENV NYA_PROXY_CONFIG_PATH=/data/config.yaml
|
| 16 |
+
|
| 17 |
+
# The base image has a non-root user named 'nya'. We will switch to it
|
| 18 |
+
# as a security best practice. The app will run as 'nya' and will
|
| 19 |
+
# have permission to write to /data/config.yaml.
|
| 20 |
+
USER nya
|