Spaces:
Running
Running
File size: 704 Bytes
64374b9 a887e31 5e64c0a a887e31 5e64c0a a887e31 5e64c0a a887e31 5e64c0a a887e31 5e64c0a a887e31 fbf85a4 a887e31 5e64c0a a887e31 |
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 |
FROM python:3.10-slim
RUN pip install --upgrade pip
# Install system dependencies
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://ollama.ai/install.sh | sh && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd user
USER user
ENV HOME=/home/user
WORKDIR $HOME/app
# Copy and install requirements as the non-root user
COPY --chown=user requirements.txt .
RUN pip install --user -r requirements.txt
# Copy the rest of the app
COPY --chown=user . .
# Make the script executable
RUN chmod +x start.sh
# Add local bin to PATH (for --user installs)
ENV PATH="$HOME/.local/bin:$PATH"
# Expose port
EXPOSE 7860
# Run the app
CMD ["./start.sh"] |