File size: 1,404 Bytes
4360442
e0bc92e
1e0b4e7
 
e0bc92e
1e0b4e7
 
e0bc92e
1e0b4e7
 
 
 
 
 
dc444bb
42e16df
1e0b4e7
e0bc92e
1e0b4e7
42e16df
 
 
 
e0bc92e
42e16df
e0bc92e
 
 
b98577a
e0bc92e
42e16df
 
 
 
 
08a82bb
837b5d6
e0bc92e
 
 
42e16df
e0bc92e
42e16df
e0bc92e
303ce0f
d5b9dc7
e0bc92e
1e0b4e7
d5b9dc7
e0bc92e
 
144ebc5
 
e0bc92e
f710f2c
144ebc5
 
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
50
51
52
53
54
55
56
57
58
FROM python:3.10-slim-buster

# Set the working directory
WORKDIR /app

# Copy requirements file
COPY requirements.txt requirements.txt

# Update package list and install necessary packages in a single step
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    libffi-dev \
    cmake \
    libcurl4-openssl-dev \
    tini && \
    apt-get clean

# Upgrade pip and install dependencies
RUN python -m venv venv && \
    . /app/venv/bin/activate && \
    pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Install Ollama
RUN curl https://ollama.ai/install.sh | sh

# Create the directory and give appropriate permissions
RUN mkdir -p /.ollama && chmod 777 /.ollama

# Ensure Ollama binary is in the PATH
ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH"

# Expose the server port
EXPOSE 7860
EXPOSE 11434
EXPOSE 1338
# Copy the entry point script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Set the model as an environment variable (this can be overridden)
ENV model="default_model"

# Copy the entire application
COPY . .

# Set proper permissions for the translations directory
RUN chmod -R 777 translations

# Copy the startup script and make it executable
#COPY start.sh .
#RUN chmod +x start.sh

# Define the command to run the application
# Set the entry point script as the default command
ENTRYPOINT ["/entrypoint.sh"]