File size: 1,093 Bytes
b3c94ce
 
 
 
 
 
 
 
a3da6c6
b3c94ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00a3b3a
b3c94ce
 
 
 
 
 
 
 
a3da6c6
b3c94ce
 
 
 
16eff4c
b3c94ce
16eff4c
b3c94ce
e7addf3
b3c94ce
 
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
FROM ollama/ollama:latest

# Change to custom app directory
WORKDIR /app
ENV HOME=/app

# Add ollama user and ensure home + ollama directories
RUN groupadd -r ollama && useradd -r -g ollama ollama \
    && mkdir -p /app/.ollama /app/.local /app/sql_files \
    && chown -R ollama:ollama /app

# Install packages
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    python3 \
    python3-pip \
    python3-venv \
    netcat-openbsd \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./
COPY src/ ./src/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY frontend/app/dist/ ./frontend/app/dist/

RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

RUN pip install --no-cache-dir -r requirements.txt

RUN chmod +x /usr/local/bin/entrypoint.sh

RUN chmod -R 777 /app/.local /app/.ollama /app/sql_files

USER ollama

ENV OLLAMA_HOST=0.0.0.0:11434
ENV PORT=7860 

EXPOSE 11434 7860 5000

HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]