instagram_bot / Dockerfile
mattysaints's picture
fix: gradio 5.x (audioop removed in Python 3.13)
64c1b95 verified
Raw
History Blame Contribute Delete
658 Bytes
FROM python:3.12-slim
# HuggingFace Docker Spaces run as UID 1000 by default. Prep home + workdir.
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1
WORKDIR $HOME/app
# Install deps first (better layer caching).
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# App code.
COPY --chown=user . .
# Port that HF Spaces expects (matches app_port in README frontmatter).
EXPOSE 7860
# Single-process uvicorn: no port collisions.
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]