afulara/PythonicRAG-FastAPI-React
0
1# Use Python 3.9 base2FROM python:3.93 4# Install Node.js & npm (for building React)5RUN apt-get update && apt-get install -y nodejs npm6 7# Create a working directory8WORKDIR /app9 10# Copy requirements and install Python deps11COPY requirements.txt /app/requirements.txt12RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt13 14# Copy the entire project15COPY . /app16 17# Build the frontend18WORKDIR /app/frontend19RUN npm install20RUN npm run build21 22# Move the built frontend into the backend static folder23WORKDIR /app24RUN cp -R /app/frontend/build /app/backend/static25 26# Expose port 7860 (Hugging Face Spaces default)27EXPOSE 786028 29# Set environment variables30ENV PORT 786031ENV HOST 0.0.0.032 33# Switch to the backend directory34WORKDIR /app/backend35 36# Run the FastAPI application37CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]38 