This commit is contained in:
+16
-11
@@ -1,17 +1,22 @@
|
||||
FROM python:3.11-slim
|
||||
# Use official Ollama image as base
|
||||
FROM ollama/ollama:latest
|
||||
|
||||
# Install Python and dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y python3 python3-pip && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt .
|
||||
# Copy source code
|
||||
COPY . /app
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy source code
|
||||
COPY src ./src
|
||||
COPY data ./data
|
||||
COPY main.py .
|
||||
# Expose port for FastAPI
|
||||
EXPOSE 8000
|
||||
|
||||
# Expose port if needed (not required for CLI)
|
||||
# EXPOSE 8000
|
||||
|
||||
CMD ["python", "src/main.py"]
|
||||
# Start Ollama server in background and run FastAPI
|
||||
CMD ["sh", "-c", "ollama serve & uvicorn src.main:app --host 0.0.0.0 --port 8000"]
|
||||
Reference in New Issue
Block a user