rag-movie-api / Dockerfile
JJTsao's picture
Update Dockerfile
38e3da4 verified
raw
history blame
598 Bytes
# Use slim base image
FROM python:3.10-slim
# Create a dedicated cache directory and assign permissions
RUN mkdir -p /home/user/.cache && chmod -R 777 /home/user/.cache
WORKDIR /app
# Set cache env vars **before** installing anything
ENV HF_HOME=/home/user/.cache/huggingface \
TRANSFORMERS_CACHE=/home/user/.cache/huggingface \
SENTENCE_TRANSFORMERS_HOME=/home/user/.cache/huggingface
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV PYTHONUNBUFFERED=1
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]