# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
# you will also find guides on how best to write your Dockerfile | |
FROM python:3.11 | |
# WORKDIR /code | |
WORKDIR / | |
ENV OLLAMA_MODELS=/data | |
RUN curl -fsSL https://ollama.com/install.sh | sh | |
RUN pip install --no-cache-dir gradio ollama | |
EXPOSE 7860 | |
ENV GRADIO_SERVER_NAME="0.0.0.0" | |
COPY . . | |
RUN mkdir -p /.ollama && chmod 777 /.ollama | |
RUN mkdir -p /data && chmod 777 /data | |
# Copy the entry point script | |
COPY entrypoint.sh /entrypoint.sh | |
RUN chmod +x /entrypoint.sh | |
# Set the entry point script as the default command | |
ENTRYPOINT ["/entrypoint.sh"] | |
# CMD ["ollama", "serve"] | |
# CMD ["python", "app.py"] | |