DeLaw_ollama / Dockerfile
Sadiksmart0's picture
Update Dockerfile
64374b9 verified
raw
history blame contribute delete
704 Bytes
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"]