Spaces:
Sleeping
Sleeping
| 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"] |