Naimul Islam Nahid commited on
Commit
29a5074
·
verified ·
1 Parent(s): 66b249c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,13 +1,15 @@
1
  # Use the official OpenWebUI image
2
  FROM ghcr.io/open-webui/open-webui:main
3
 
4
- # Hugging Face Spaces run as non-root user 1000.
5
- # We must switch to root temporarily to ensure permissions are correct.
 
 
 
6
  USER root
7
- RUN mkdir -p /app/backend/data && chown -R 1000:1000 /app
8
 
9
- # Switch back to the required Hugging Face user
10
- USER 1000
11
 
12
  # Set networking environment variables for Hugging Face
13
  ENV PORT=7860
@@ -19,9 +21,6 @@ ENV DATA_DIR=/app/backend/data
19
  # -----------------------------------------------------------------
20
  # RESOURCE LIMITATION (Max 95% usage to prevent overloading)
21
  # -----------------------------------------------------------------
22
- # The free tier has 2 vCPUs and 16GB RAM. OpenWebUI is naturally lightweight
23
- # (using ~1GB RAM). By strictly limiting the workers and memory arena,
24
- # we ensure the container never spikes above the 15.2GB (95%) danger zone.
25
  ENV WEBUI_WORKERS=1
26
  ENV MALLOC_ARENA_MAX=2
27
 
 
1
  # Use the official OpenWebUI image
2
  FROM ghcr.io/open-webui/open-webui:main
3
 
4
+ # -----------------------------------------------------------------
5
+ # CRITICAL FIX: Run as root.
6
+ # Hugging Face mounts Storage Buckets with root ownership.
7
+ # Running as root ensures OpenWebUI has permission to write the database.
8
+ # -----------------------------------------------------------------
9
  USER root
 
10
 
11
+ # Ensure the data directory exists
12
+ RUN mkdir -p /app/backend/data
13
 
14
  # Set networking environment variables for Hugging Face
15
  ENV PORT=7860
 
21
  # -----------------------------------------------------------------
22
  # RESOURCE LIMITATION (Max 95% usage to prevent overloading)
23
  # -----------------------------------------------------------------
 
 
 
24
  ENV WEBUI_WORKERS=1
25
  ENV MALLOC_ARENA_MAX=2
26