-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
49 lines (38 loc) · 1010 Bytes
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.9-slim-buster
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
ffmpeg \
curl \
espeak \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file
COPY app/requirements.txt .
# Install Python dependencies with verbose output
RUN pip install --no-cache-dir -v -r requirements.txt
# Install Ollama
RUN curl https://ollama.ai/install.sh | sh
# Copy the application code
COPY app /app
COPY config /app/config
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Create a volume for Ollama's model storage
VOLUME /root/.ollama
# Make port 11434 available to the world outside this container
EXPOSE 11434
# Copy and set the entrypoint script
USER root
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]