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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -1,20 +1,17 @@
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
 
1
  # Start from the official NyaProxy image
2
  FROM k3scat/nya-proxy:latest
3
 
4
+ # Switch to the root user to create our writable directory
5
  USER root
6
 
7
+ # Create a /data directory and give ownership to the 'nya' user,
8
+ # which we know exists inside the base image.
9
+ RUN mkdir /data && chown nya:nya /data
 
 
10
 
11
+ # Switch back to the non-root 'nya' user for security
12
+ USER nya
 
13
 
14
+ # IMPORTANT: Override the default command to point to the new config path.
15
+ # The original command was ["--config", "config.yaml"].
16
+ # We are changing it to use an absolute path to our writable directory.
17
+ CMD ["--config", "/data/config.yaml"]