Spaces:
Build error
Build error
File size: 1,146 Bytes
413a7c5 c47212f 1e04944 c9ff3dd 31ed4a7 1e04944 c9ff3dd 413a7c5 1e04944 c9ff3dd 413a7c5 1e04944 c9ff3dd 413a7c5 1e04944 c9ff3dd c47212f 1e04944 c9ff3dd c47212f 1e04944 c9ff3dd c47212f 1e04944 c9ff3dd 1e04944 c9ff3dd 1e04944 fcf4926 1e04944 9dfecc5 1e04944 413a7c5 1e04944 |
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 33 34 35 36 37 38 39 40 41 42 43 44 |
# Use the official Python image from the Docker Hub
FROM python:3.9
# Install curl
RUN apt-get update && apt-get install -y curl
RUN curl -fsSL https://ollama.com/install.sh | sh
# # Create a new user with a home directory and set the user ID
RUN useradd -m -u 1000 user
# # Switch to the new user
USER user
# # Set the PATH environment variable to include the user's local bin directory
ENV PATH="/home/user/.local/bin:$PATH"
# # Set the working directory to /app
WORKDIR /app
# # Copy the requirements.txt file and install the dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# # Copy the rest of the application code to the /app directory
COPY --chown=user . /app
# Install Ollama
# Create the directory and give appropriate permissions
# RUN mkdir -p /.app && chmod 777 /.app
# WORKDIR /.app
# Copy the entry point script
COPY entry.sh /app/entry.sh
RUN chmod +x /app/entry.sh
ENTRYPOINT ["/entry.sh"]
CMD ["ollama", "serve"]
# Set the command to run the application
# CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
EXPOSE 7860 |