NikaMimi commited on
Commit
017e6d3
·
verified ·
1 Parent(s): ed6f781

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 temporarily to fix permissions
5
  USER root
6
 
7
- # Change the ownership of the /app directory to the 'user' that
8
- # Hugging Face uses to run the container. The -R makes it recursive.
9
- RUN chown -R user:user /app
 
 
10
 
11
- # Switch back to the standard 'user' for running the application
12
- USER user
 
 
 
 
 
 
 
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