Spaces:
Runtime error
Runtime error
| FROM python:3.9 | |
| # Install Node.js (use newer version) | |
| RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - | |
| RUN apt-get install -y nodejs | |
| # Set working directory | |
| WORKDIR /app | |
| # Set environment variables | |
| ENV MCO_CONFIG_DIR=/app/mco-config | |
| ENV PYTHONUNBUFFERED=1 | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Create MCO config directory | |
| RUN mkdir -p /app/mco-config | |
| # Install MCO Protocol and copy server file | |
| RUN npm install @paradiselabs/mco-protocol && \ | |
| echo "Checking MCO installation structure:" && \ | |
| find node_modules/@paradiselabs/mco-protocol/ -name "*.js" -type f && \ | |
| if [ -f "node_modules/@paradiselabs/mco-protocol/bin/mco-server.js" ]; then \ | |
| cp node_modules/@paradiselabs/mco-protocol/bin/mco-server.js /app/mco-mcp-server.js; \ | |
| echo "Copied bin/mco-server.js"; \ | |
| elif [ -f "node_modules/@paradiselabs/mco-protocol/lib/index.js" ]; then \ | |
| cp node_modules/@paradiselabs/mco-protocol/lib/index.js /app/mco-mcp-server.js; \ | |
| echo "Copied lib/index.js"; \ | |
| else \ | |
| echo "No server file found, creating fallback"; \ | |
| echo 'console.log("MCO server fallback");' > /app/mco-mcp-server.js; \ | |
| fi | |
| # Expose port for Gradio | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["python", "app.py"] | |