Spaces:
Sleeping
Sleeping
| FROM python:3.13-slim | |
| # Install Node.js and npm | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | |
| && apt-get install -y nodejs \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy backend requirements | |
| COPY backend/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy backend code | |
| COPY backend/ ./backend/ | |
| COPY backend/aimakerspace/ ./aimakerspace/ | |
| # Copy frontend code | |
| COPY frontend/ ./frontend/ | |
| # Install frontend dependencies and build | |
| WORKDIR /app/frontend | |
| RUN npm install | |
| RUN npm run build | |
| # Set environment variables | |
| ENV OPENAI_API_KEY=${OPENAI_API_KEY} | |
| ENV PORT=7860 | |
| # Expose port | |
| EXPOSE 7860 | |
| # Start both backend and frontend | |
| WORKDIR /app | |
| CMD ["sh", "-c", "cd backend && uvicorn main:app --host 0.0.0.0 --port 7860"] |