File size: 927 Bytes
ed30e83
 
 
 
 
 
 
 
 
 
 
 
 
1bf8cee
 
 
 
ed30e83
 
 
 
 
 
 
1bf8cee
 
ed30e83
1bf8cee
ed30e83
1bf8cee
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11

# Install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh

# Set working directory
WORKDIR /code

# Set Ollama environment variables
ENV OLLAMA_HOST=0.0.0.0:11434
ENV OLLAMA_HOME=/code/.ollama

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY . .

# Create Ollama directories with proper permissions
RUN mkdir -p /code/.ollama && chmod 755 /code/.ollama

# Expose ports
EXPOSE 7860
EXPOSE 11434

# Create startup script
RUN echo '#!/bin/bash\n\
export OLLAMA_HOME=/code/.ollama\n\
export OLLAMA_HOST=0.0.0.0:11434\n\
ollama serve &\n\
sleep 15\n\
ollama pull llm_hub/child_trauma_gemma\n\
python app.py' > /code/start.sh && chmod +x /code/start.sh

CMD ["/code/start.sh"]