SporalizeLabs-api / Dockerfile
Shoraky's picture
Initial public API deployment
490eb58 verified
raw
history blame contribute delete
742 Bytes
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PORT=7860 \
HF_HOME=/home/appuser/.cache/huggingface
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libglib2.0-0 \
libgl1 \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --uid 1000 appuser
WORKDIR /app
COPY --chown=appuser:appuser requirements.txt /app/requirements.txt
RUN pip install --upgrade pip && pip install -r /app/requirements.txt
COPY --chown=appuser:appuser api.py /app/api.py
COPY --chown=appuser:appuser README.md /app/README.md
USER appuser
EXPOSE 7860
CMD ["sh", "-c", "uvicorn api:app --host 0.0.0.0 --port ${PORT:-7860}"]