Spaces:
Running
Running
File size: 1,225 Bytes
e6863eb b52bd15 e6863eb b52bd15 e6863eb 7694c1b b52bd15 caf3ec3 b52bd15 caf3ec3 b52bd15 e6863eb b52bd15 e6863eb b52bd15 1ab7842 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # ---------------------------------------------------------
# 1️⃣ Use the official OpenWebUI image (latest tag)
# ---------------------------------------------------------
FROM ghcr.io/open-webui/open-webui:main
# ---------------------------------------------------------
# 2️⃣ Set Environment Variables
# ---------------------------------------------------------
ENV ENABLE_OPENAI_API=true
ENV DISABLE_EMBEDDINGS=false
# Explicitly set the data directory to a path we control
ENV DATA_DIR=/app/backend/data
# ---------------------------------------------------------
# 3️⃣ Fix Permissions for Hugging Face Spaces
# ---------------------------------------------------------
# HF Spaces run as user 1000. We must ensure this user has read/write
# access to the data directory where the SQLite DB is created.
USER root
RUN mkdir -p $DATA_DIR && \
chown -R 1000:1000 /app && \
chmod -R 777 $DATA_DIR
USER 1000
# ---------------------------------------------------------
# 4️⃣ Expose port
# ---------------------------------------------------------
# Open WebUI defaults to 8080. If HF Spaces expects 7860,
# you MUST tell Open WebUI to run on 7860 using the PORT env var.
ENV PORT=7860
EXPOSE 7860 |