poetica / Dockerfile
abhisheksan's picture
Set HF_HOME environment variable for caching in Dockerfile
86e94f2
raw
history blame
541 Bytes
# Dockerfile
FROM python:3.10
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
ENV HF_HOME="/tmp/poetica-cache"
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdir -m 777 /tmp/poetica-cache
# Copy the application code
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]