File size: 834 Bytes
35f070c f5bff06 f851482 35f070c f851482 f5bff06 f851482 ce8e0e7 35f070c f851482 f5bff06 ce8e0e7 f5bff06 f851482 ce8e0e7 f5bff06 938ab75 f5bff06 f851482 ce8e0e7 938ab75 f5bff06 938ab75 ce8e0e7 938ab75 |
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 |
FROM python:3.11-slim
WORKDIR /app
# Set timezone non-interactively
ENV TZ=Asia/Singapore
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
libgl1 \
libglib2.0-0 \
curl \
gcc \
g++ \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# Install Python packages
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY app.py .
# Create non-root user
RUN useradd -m -u 1000 streamlit && \
chown -R streamlit:streamlit /app
USER streamlit
EXPOSE 7860
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |