thejagstudio commited on
Commit
b52bd15
·
verified ·
1 Parent(s): 34c044a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -5
Dockerfile CHANGED
@@ -1,17 +1,32 @@
1
  # ---------------------------------------------------------
2
  # 1️⃣ Use the official OpenWebUI image (latest tag)
3
  # ---------------------------------------------------------
4
- FROM ghcr.io/open-webui/open-webui:latest
 
5
  # ---------------------------------------------------------
6
- # 2️⃣ Enable the OpenAI‑compatible API (required for /v1/*)
7
  # ---------------------------------------------------------
8
  ENV ENABLE_OPENAI_API=true
9
  ENV DISABLE_EMBEDDINGS=false
 
 
 
 
 
 
 
 
10
  USER root
11
- RUN mkdir -p /app/data && chown -R 1000:1000 /app/data && chmod -R 777 /app/data
 
 
 
12
  USER 1000
 
13
  # ---------------------------------------------------------
14
- # 3️⃣ (Optional) Expose a different host port – HF will map
15
- # the container’s 8080 → the Space’s public URL automatically.
16
  # ---------------------------------------------------------
 
 
 
17
  EXPOSE 7860
 
1
  # ---------------------------------------------------------
2
  # 1️⃣ Use the official OpenWebUI image (latest tag)
3
  # ---------------------------------------------------------
4
+ FROM ghcr.io/open-webui/open-webui:main
5
+
6
  # ---------------------------------------------------------
7
+ # 2️⃣ Set Environment Variables
8
  # ---------------------------------------------------------
9
  ENV ENABLE_OPENAI_API=true
10
  ENV DISABLE_EMBEDDINGS=false
11
+ # Explicitly set the data directory to a path we control
12
+ ENV DATA_DIR=/app/backend/data
13
+
14
+ # ---------------------------------------------------------
15
+ # 3️⃣ Fix Permissions for Hugging Face Spaces
16
+ # ---------------------------------------------------------
17
+ # HF Spaces run as user 1000. We must ensure this user has read/write
18
+ # access to the data directory where the SQLite DB is created.
19
  USER root
20
+ RUN mkdir -p $DATA_DIR && \
21
+ chown -R 1000:1000 /app && \
22
+ chmod -R 777 $DATA_DIR
23
+
24
  USER 1000
25
+
26
  # ---------------------------------------------------------
27
+ # 4️⃣ Expose port
 
28
  # ---------------------------------------------------------
29
+ # Open WebUI defaults to 8080. If HF Spaces expects 7860,
30
+ # you MUST tell Open WebUI to run on 7860 using the PORT env var.
31
+ ENV PORT=7860
32
  EXPOSE 7860