csm-1b / Dockerfile
alethanhson
fix
b460716
raw
history blame contribute delete
706 Bytes
FROM python:3.10-slim
# Install system dependencies as root
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
wget \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Create directories that will be needed later
RUN mkdir -p /home/user/.cache/huggingface /home/user/.local
RUN useradd -m -u 1000 user
RUN chown -R user:user /home/user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy application files
COPY --chown=user . .
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8
EXPOSE 7860
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]