leaderboard-docker / Dockerfile
arshy's picture
updates
67e1b3f
raw
history blame
1.77 kB
# 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/*
# Upgrade to a more recent SQLite version
RUN wget https://www.sqlite.org/2021/sqlite-autoconf-3360000.tar.gz && \
tar xvfz sqlite-autoconf-3360000.tar.gz && \
cd sqlite-autoconf-3360000 && \
./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-3360000.tar.gz && \
rm -rf sqlite-autoconf-3360000
# Verify sqlite3 version system-wide
RUN sqlite3 --version
# Install Python dependencies
RUN pip install poetry gradio
# After installing dependencies, check SQLite version in Python
RUN python -c "import sqlite3; print('Python SQLite version:', sqlite3.sqlite_version)"
# Create a non-root user and change ownership of the /app directory
RUN adduser --disabled-password --gecos '' myuser && \
chown -R myuser:myuser /app
# Switch to the non-root user
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"]