carbot-mixtral / Dockerfile
imstevenleo's picture
Resolve Dockerfile merge conflict
8697756
raw
history blame
592 Bytes
FROM python:3.10-slim
# Set up a user with proper permissions
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Set cache directory for Hugging Face models
ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface
RUN mkdir -p /home/user/.cache/huggingface && chown -R user:user /home/user/.cache
# Copy and install requirements first to leverage caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all project files
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]