Spaces:
Build error
Build error
| # Stage 1: Build Frontend | |
| FROM node:20 as frontend-builder | |
| WORKDIR /app/frontend | |
| COPY techhubprototypeucfrontend/package*.json ./ | |
| RUN npm install | |
| COPY techhubprototypeucfrontend/ . | |
| RUN npm run build | |
| # Stage 2: Backend | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies if needed | |
| # RUN apt-get update && apt-get install -y --no-install-recommends gcc && rm -rf /var/lib/apt/lists/* | |
| COPY techhubprototypeucbackend/requirements.txt . | |
| # Remove pyaudio from requirements if it's there, as it requires system dependencies and we removed usage | |
| RUN sed -i '/pyaudio/d' requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY techhubprototypeucbackend/ . | |
| # Copy frontend build to static folder | |
| COPY --from=frontend-builder /app/frontend/dist ./static | |
| # Expose port 7860 (Hugging Face Spaces default) | |
| EXPOSE 7860 | |
| # Run the app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |