File size: 1,158 Bytes
fd5cd29
 
 
 
9bbcc1e
fd5cd29
9bbcc1e
fd5cd29
 
9bbcc1e
 
 
 
 
 
 
 
 
 
 
fd5cd29
3d83381
fd5cd29
9bbcc1e
 
 
 
 
fd5cd29
9bbcc1e
 
24d09a0
fd5cd29
9bbcc1e
fd5cd29
161df35
 
 
 
 
 
fd5cd29
 
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
FROM python:3.10.7

WORKDIR /app

# Install dependencies for building sqlite3 from source
RUN apt-get update && \
    apt-get install -y wget build-essential libsqlite3-dev && \
    apt-get clean

# Download and compile the latest sqlite3
RUN wget https://www.sqlite.org/2023/sqlite-autoconf-3430000.tar.gz && \
    tar xzf sqlite-autoconf-3430000.tar.gz && \
    cd sqlite-autoconf-3430000 && \
    ./configure && \
    make && \
    make install && \
    ldconfig && \
    cd .. && \
    rm -rf sqlite-autoconf-3430000 sqlite-autoconf-3430000.tar.gz

# Verify the sqlite3 version
RUN sqlite3 --version

# Set environment variables to ensure the new SQLite is used
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ENV PATH="/usr/local/bin:${PATH}"

COPY ./requirements.txt /app/requirements.txt

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r /app/requirements.txt

COPY . /app

# Create a non-root user and switch to it
RUN useradd -m myuser
USER myuser

# Set the NLTK_DATA environment variable
ENV NLTK_DATA /home/myuser/.nltk_data

CMD ["chainlit", "run", "app.py", "--port", "7860"]