Spaces:
Runtime error
Runtime error
Iban Eguia Moraza commited on
Added persistent storage
Browse files- Dockerfile +75 -0
Dockerfile
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
| 2 |
+
# you will also find guides on how best to write your Dockerfile
|
| 3 |
+
|
| 4 |
+
# FROM python:3.11-trixie
|
| 5 |
+
|
| 6 |
+
# # The two following lines are requirements for the Dev Mode to be functional
|
| 7 |
+
# # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
|
| 8 |
+
# RUN useradd -m -u 1000 user
|
| 9 |
+
# WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# COPY --chown=user ./requirements.txt requirements.txt
|
| 12 |
+
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# COPY --chown=user . /app
|
| 15 |
+
# CMD ["bash", "run.sh"]
|
| 16 |
+
|
| 17 |
+
FROM ghcr.io/open-webui/open-webui:main
|
| 18 |
+
|
| 19 |
+
# Set up a new user named "user" with user ID 1000 (Hugging Face requirement)
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
RUN chown -R user:user /app
|
| 22 |
+
RUN chown -R user:user /data
|
| 23 |
+
|
| 24 |
+
# Switch to the "user" user
|
| 25 |
+
USER user
|
| 26 |
+
|
| 27 |
+
# Set environment variables for Hugging Face Spaces
|
| 28 |
+
ENV PORT=7860
|
| 29 |
+
ENV HOST=0.0.0.0
|
| 30 |
+
|
| 31 |
+
# Disable Ollama, ensure OpenAI API is enabled
|
| 32 |
+
ENV ENABLE_OLLAMA_API=false
|
| 33 |
+
ENV ENABLE_OPENAI_API=true
|
| 34 |
+
ENV DATA_DIR=/data
|
| 35 |
+
|
| 36 |
+
# Temporary workaround until we figure out how this works
|
| 37 |
+
# ENV WEBUI_SECRET_KEY="t0p-s3cr3t"
|
| 38 |
+
|
| 39 |
+
# FROM python:3.11-slim-trixie
|
| 40 |
+
# WORKDIR /app
|
| 41 |
+
|
| 42 |
+
# USER root
|
| 43 |
+
|
| 44 |
+
# # RUN apk add --update --no-cache build-base rust cargo
|
| 45 |
+
# RUN apt update
|
| 46 |
+
# RUN apt install -y build-essential rustc cargo wget
|
| 47 |
+
# RUN pip install --upgrade pip setuptools
|
| 48 |
+
|
| 49 |
+
# # COPY requirements.txt .
|
| 50 |
+
# # RUN pip install -r requirements.txt
|
| 51 |
+
|
| 52 |
+
# # RUN apt update
|
| 53 |
+
# # RUN apt install -y wget
|
| 54 |
+
|
| 55 |
+
# COPY run.sh .
|
| 56 |
+
# RUN chmod +x run.sh
|
| 57 |
+
|
| 58 |
+
# USER pn
|
| 59 |
+
# ENV HOME=/home/pn \
|
| 60 |
+
# PATH=/home/pn/.local/bin:$PATH
|
| 61 |
+
|
| 62 |
+
# RUN mkdir $HOME/app
|
| 63 |
+
# WORKDIR $HOME/app
|
| 64 |
+
|
| 65 |
+
# COPY --chown=pn requirements.txt requirements.txt
|
| 66 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
| 67 |
+
|
| 68 |
+
# # Copy nginx configuration
|
| 69 |
+
# # COPY --chown=pn nginx.conf /etc/nginx/sites-available/default
|
| 70 |
+
|
| 71 |
+
# COPY --chown=pn . .
|
| 72 |
+
|
| 73 |
+
# EXPOSE 8080
|
| 74 |
+
|
| 75 |
+
# CMD ["bash", "run.sh"]
|