images / Dockerfile
badalsahani's picture
Update Dockerfile
b0add77 verified
# Use the official Python image as base image
FROM python:3.9-slim
RUN mkdir -p /app
RUN chmod 777 /app
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
HF_HOME=/.cache
# Set working directory
WORKDIR /app
# Create a directory for transformers cache
RUN mkdir -p $HF_HOME
RUN chmod 777 $HF_HOME
# Copy requirements.txt to the working directory
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code to the container
COPY . .
# Command to run the FastAPI application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]