Usman / Dockerfile
Waqasjan123's picture
Fix: UID 1000 user, port 7860, Python 3.10, fix deprecation warnings
ff4a7bc verified
raw
history blame contribute delete
775 Bytes
FROM python:3.10-slim
# Install system deps
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create user with UID 1000 (required by HF Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Install Python deps
COPY --chown=user requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy app files
COPY --chown=user src/ ./src/
COPY --chown=user .streamlit/ ./.streamlit/
EXPOSE 7860
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]