aibeecara-model / Dockerfile
M Farrel Danendra Rachim
ddd
58e8b4f
raw
history blame contribute delete
654 Bytes
# Use a lightweight and stable Python base image
FROM python:3.10-slim
# Set environment variables to prevent cache permission issues
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
ENV PIP_NO_CACHE_DIR=1
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /app
# Copy files into the container
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Expose the default port used by Hugging Face Spaces
EXPOSE 7860
# Run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]