File size: 1,568 Bytes
6425b43
df069ee
52938ea
6425b43
52938ea
 
6425b43
52938ea
 
c32b98e
52938ea
c32b98e
52938ea
 
 
c32b98e
 
 
 
 
 
 
 
 
 
 
 
 
 
6425b43
d84b067
52938ea
6425b43
 
 
 
52938ea
6425b43
52938ea
 
4213e37
 
6425b43
 
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim-bullseye

# Set the working directory in the container to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install system dependencies required for building sqlite3 and other operations
RUN apt-get update && \
    apt-get install -y --no-install-recommends git wget build-essential libsqlite3-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Download and compile sqlite3 from source
RUN wget https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
    tar xvfz sqlite-autoconf-3350500.tar.gz && \
    cd sqlite-autoconf-3350500 && \
    ./configure --prefix=/usr --disable-static CFLAGS="-DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_ENABLE_FTS3_TOKENIZER=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_ENABLE_RTREE=1" && \
    make && \
    make install && \
    cd .. && \
    rm sqlite-autoconf-3350500.tar.gz && \
    rm -rf sqlite-autoconf-3350500

# Verify sqlite3 version
RUN sqlite3 --version

# Install Python dependencies
RUN pip install poetry gradio

# Create a non-root user and change ownership of the /app directory
RUN adduser --disabled-password --gecos '' myuser && \
    chown -R myuser:myuser /app
USER myuser

# Expose the port Gradio runs on
EXPOSE 7860

RUN chmod +x /app/start.sh

# Run the start script when the container launches
CMD ["/app/start.sh"]