Spaces:
Sleeping
Sleeping
File size: 903 Bytes
72a7ef8 af4b861 | 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 32 | # Use official Python 3.11 image
FROM python:3.11
# Set working directory inside the container
WORKDIR /code
# Copy requirements from the Backend folder
COPY ./backend/requirements.txt /code/requirements.txt
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the Backend code into the container
COPY ./backend /code/app
# Create necessary directories for Docs and DB
RUN mkdir -p /code/app/Docs
RUN mkdir -p /code/app/chroma_db
# GRANT PERMISSIONS: Hugging Face runs as a non-root user (user 1000)
# We must allow it to write to these folders to save the database.
RUN chmod -R 777 /code/app/Docs
RUN chmod -R 777 /code/app/chroma_db
# Set working directory to the app folder
WORKDIR /code/app
# Expose port 7860 (Hugging Face default)
EXPOSE 7860
# Start the server on port 7860
CMD ["uvicorn", "Server:App", "--host", "0.0.0.0", "--port", "7860"] |