Spaces:
Runtime error
Runtime error
File size: 774 Bytes
d0e789c fa2e59f d0e789c 19ec448 fa2e59f d0e789c 19ec448 fa2e59f d0e789c fa2e59f d0e789c fa2e59f d0e789c cfc0cb7 d0e789c afdc45a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # Use an official Python runtime as a parent image
FROM python:3.8-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6
# Set environment variable for transformers cache
ENV TRANSFORMERS_CACHE=/app/cache
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 8000 for the FastAPI app
EXPOSE 8000
# Create cache directory
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Run the FastAPI app with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|