ArunKr commited on
Commit
05b84e9
·
verified ·
1 Parent(s): d3d1d61

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -28,11 +28,17 @@ RUN chmod +x /app/start.sh
28
  # We need to make sure the data directory is writable by UID 1000.
29
 
30
  # Create the data directory and give permissions to UID 1000
 
 
 
31
  RUN mkdir -p /var/lib/postgresql/data && \
32
- chown -R 1000:1000 /var/lib/postgresql/data && \
33
  chmod 700 /var/lib/postgresql/data
34
 
35
- # Expose the port for pgweb (HF Spaces expects 7860)
 
 
 
36
  EXPOSE 7860
37
 
38
  # Set the entrypoint to our custom script
 
28
  # We need to make sure the data directory is writable by UID 1000.
29
 
30
  # Create the data directory and give permissions to UID 1000
31
+ # We create a user with UID 1000 to match HF Spaces default and avoid root errors
32
+ RUN useradd -m -u 1000 hf_user
33
+
34
  RUN mkdir -p /var/lib/postgresql/data && \
35
+ chown -R hf_user:hf_user /var/lib/postgresql/data && \
36
  chmod 700 /var/lib/postgresql/data
37
 
38
+ # Switch to the non-root user
39
+ USER hf_user
40
+
41
+ # Expose the port for Postgres
42
  EXPOSE 7860
43
 
44
  # Set the entrypoint to our custom script