File size: 834 Bytes
6c920e3
 
 
 
 
 
 
 
 
 
3e30d2f
 
 
 
 
 
 
 
 
 
 
 
 
6c920e3
 
 
 
3e30d2f
 
6c920e3
 
 
 
3e30d2f
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
# โœ… Use Python 3.11 (ensures compatibility with pysqlite3)
FROM python:3.11-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    libsqlite3-dev \
    && rm -rf /var/lib/apt/lists/*

# Add a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Copy and install dependencies
COPY --chown=user requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# ๐Ÿ‘‰ Fix sqlite issue by installing pysqlite3-binary
RUN pip install pysqlite3-binary==0.5.2

# Copy the entire app
COPY --chown=user . /app

# Expose the port (required by HF)
EXPOSE 7860

# Run the Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]