Knowcer / Dockerfile
lp128396's picture
Update Dockerfile
a18c234 verified
raw
history blame contribute delete
681 Bytes
FROM python:3.9-slim
# βœ… Define all writable paths explicitly
ENV PYTHONUNBUFFERED=1 \
PORT=8501 \
HF_HOME=/tmp/huggingface \
XDG_CACHE_HOME=/tmp/.cache \
STREAMLIT_HOME=/tmp/.streamlit \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_SERVER_PORT=8501 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
COPY src/ ./src/
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "src/app.py"]