Spaces:
Runtime error
Runtime error
| FROM ollama/ollama:latest | |
| # Install Python and pip | |
| RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user | |
| RUN useradd -ms /bin/bash user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME | |
| # Copy application files and set ownership | |
| COPY requirements.txt $HOME/requirements.txt | |
| COPY entrypoint.sh $HOME/entrypoint.sh | |
| COPY profile.png $HOME/profile.png | |
| # Ensure correct permissions for Ollama data directory | |
| RUN mkdir -p $HOME/.ollama && chown -R user:user $HOME | |
| # Switch to the non-root user | |
| USER user | |
| # Install Python dependencies | |
| RUN pip3 install -r requirements.txt | |
| # Make the entrypoint script executable | |
| RUN chmod +x $HOME/entrypoint.sh | |
| RUN ls -la $HOME | |
| # Define the entrypoint for the container | |
| ENTRYPOINT ["/home/user/entrypoint.sh"] |