Insulin / Dockerfile
GDMProjects's picture
Update Dockerfile
30c7349 verified
raw
history blame
1.04 kB
FROM python:3.10-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# App workdir
WORKDIR /app
ENV HOME=/app \
HF_HOME=/data/.hf \
HUGGINGFACE_HUB_CACHE=/data/.hf/cache \
TRANSFORMERS_CACHE=/data/.cache/huggingface
RUN mkdir -p /data/.hf/cache /data/.cache/huggingface \
&& chmod -R a+rw /data
# --------------------------------------------------
# Copy files first (owned by root initially)
COPY app.py .
COPY requirements.txt .
COPY INS.xlsx .
# Install Python deps
RUN pip install --no-cache-dir -r requirements.txt
# Make /app writable for the runtime user to avoid PyCaret logging warnings
# (Hugging Face Spaces often runs as a non-root user)
RUN chmod -R a+rw /app
# Optional: pre-create a writable log file to silence the warning completely
RUN touch /app/logs.log && chmod 666 /app/logs.log
# Gradio / Matplotlib envs
EXPOSE 7860
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV PYTHONUNBUFFERED=1
CMD ["python", "app.py"]