knowledge-assistant / Dockerfile
rahuln2002's picture
Update Dockerfile
2262958 verified
raw
history blame
622 Bytes
FROM python:3.12.9-slim-bookworm
WORKDIR /app
ENV OLLAMA_DIR=/app/.ollama
COPY requirements.txt .
RUN apt update && apt install -y curl git
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir -p /app/logs /app/.ollama && chmod -R 777 /app/.ollama /app/logs
RUN python -c "from transformers import AutoModelForSeq2SeqLM; AutoModelForSeq2SeqLM.from_pretrained('facebook/bart-large-cnn')"
RUN curl -fsSL https://ollama.com/install.sh -o install.sh && chmod +x install.sh && ./install.sh && rm install.sh
COPY . .
EXPOSE 7860
CMD ["sh", "-c", "ollama serve & sleep 5 && ollama pull nomic-embed-text && python app.py"]