| FROM python:3.11 | |
| WORKDIR /app | |
| # Install Node.js for frontend build | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - | |
| RUN apt-get update && apt-get install -y nodejs | |
| # Copy and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install -r requirements.txt | |
| # Copy package files for frontend | |
| COPY frontend/package*.json ./frontend/ | |
| # Install frontend dependencies | |
| RUN cd frontend && npm install | |
| # Copy all files | |
| COPY . . | |
| # Build frontend | |
| RUN cd frontend && npm run build | |
| # Make the startup script executable | |
| RUN chmod +x start_app.py | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["python", "start_app.py"] |