h2phy / Dockerfile
laichai's picture
Update Dockerfile
f851482 verified
raw
history blame contribute delete
834 Bytes
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"]