Last active
November 17, 2025 09:14
-
-
Save xArieN9x/f63fe2d68f17d90a92cfa3851031a71a to your computer and use it in GitHub Desktop.
claude app, docker etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # v7 โ Blueprint & starter implementation | |
| **Tujuan:** Reka bentuk V7 ikut struktur memory ChatGPT/Any (latest & complete) siap dengan contoh implementasi untuk R&D: Colab (model), Supabase (memory), Render free-tier (deployment via Docker). | |
| > Struktur projek (basic): | |
| ``` | |
| main/ | |
| |- mike_core/ # brain: orchestrator, core, tools adapters | |
| | |- __init__.py | |
| | |- orchestrator.py | |
| | |- rag.py | |
| | |- reasoning.py | |
| | |- memory.py | |
| | |- embeddings.py | |
| |- templates/ | |
| | |- chat.html | |
| |- DataBank/ | |
| | |- ??? # manual key in data from website using json type or anything | |
| | |- ??? # Auto data insert, base by web crawling after user request or demand to do | |
| |- app.py # FastAPI app, HTTP endpoints for chat, memory, health | |
| |- Dockerfile | |
| |- .dockerignore | |
| |- requirements.txt | |
| |- render.yml | |
| |- runtime.txt | |
| |- README.md | |
| Dockerfile - Container setup | |
| ======= | |
| FROM python:3.11-slim | |
| # Environment variables | |
| ENV PIP_NO_CACHE_DIR=1 | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=8000 | |
| WORKDIR /app | |
| # Install system dependencies (minimal) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| g++ \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements (force rebuild each deploy) | |
| ADD requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install dependencies in specific order to avoid conflicts | |
| # 1. Install core dependencies first | |
| RUN pip install --no-cache-dir \ | |
| fastapi==0.115.5 \ | |
| uvicorn[standard]==0.34.0 \ | |
| python-multipart==0.0.20 | |
| # 2. Install database client (use latest stable version) | |
| RUN pip install --no-cache-dir \ | |
| supabase==2.24.0 \ | |
| psycopg2-binary==2.9.10 | |
| # 3. Install web scraping tools | |
| RUN pip install --no-cache-dir \ | |
| beautifulsoup4==4.12.3 \ | |
| requests==2.32.3 \ | |
| aiohttp==3.11.11 \ | |
| yt-dlp==2024.12.23 | |
| # 4. Install utilities | |
| RUN pip install --no-cache-dir \ | |
| pydantic==2.10.4 \ | |
| pydantic-settings==2.7.0 \ | |
| python-dotenv==1.0.1 \ | |
| PyYAML==6.0.2 \ | |
| aiofiles==24.1.0 \ | |
| loguru==0.7.3 | |
| # Copy application code | |
| COPY . . | |
| # Create necessary directories | |
| RUN mkdir -p /app/logs /app/temp | |
| # Expose port | |
| EXPOSE 8000 | |
| # Cleanup Python cache | |
| RUN find . -type d -name __pycache__ -exec rm -rf {} + || true && \ | |
| find . -type f -name '*.pyc' -delete || true | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:8000/health || exit 1 | |
| # Run application | |
| CMD uvicorn app:app --host 0.0.0.0 --port $PORT | |
| ===================================================== | |
| .dockerignore - Ignore files | |
| ======= | |
| # Python | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| *.so | |
| .Python | |
| build/ | |
| develop-eggs/ | |
| dist/ | |
| downloads/ | |
| eggs/ | |
| .eggs/ | |
| lib/ | |
| lib64/ | |
| parts/ | |
| sdist/ | |
| var/ | |
| wheels/ | |
| *.egg-info/ | |
| .installed.cfg | |
| *.egg | |
| # Virtual environments | |
| venv/ | |
| ENV/ | |
| env/ | |
| .venv | |
| # IDEs | |
| .vscode/ | |
| .idea/ | |
| *.swp | |
| *.swo | |
| *~ | |
| # OS | |
| .DS_Store | |
| Thumbs.db | |
| # Git | |
| .git/ | |
| .gitignore | |
| .gitattributes | |
| # Logs | |
| *.log | |
| logs/ | |
| # Temp files | |
| temp/ | |
| tmp/ | |
| *.tmp | |
| # Data files (shouldn't be in container) | |
| datasets/ | |
| models/ | |
| vectors/ | |
| # Docs | |
| README.md | |
| docs/ | |
| *.md | |
| # CI/CD | |
| .github/ | |
| .gitlab-ci.yml | |
| # Notebooks | |
| notebooks/ | |
| *.ipynb | |
| # Tests | |
| tests/ | |
| test_*.py | |
| *_test.py | |
| ===================================================== | |
| requirements.txt - Dependencies | |
| ======= | |
| # Mike v7 Mark1 - Requirements for Docker/Render | |
| # API-only mode (no heavy ML packages) | |
| # Web Framework | |
| fastapi==0.115.5 | |
| uvicorn[standard]==0.34.0 | |
| python-multipart==0.0.20 | |
| # Database | |
| supabase==2.24.0 | |
| psycopg2-binary==2.9.10 | |
| # Web Scraping | |
| beautifulsoup4==4.12.3 | |
| requests==2.32.3 | |
| aiohttp==3.11.11 | |
| yt-dlp==2024.12.23 | |
| # Data & Config | |
| pydantic==2.11.7 | |
| pydantic-settings==2.7.1 | |
| python-dotenv==1.0.1 | |
| PyYAML==6.0.2 | |
| aiofiles==24.1.0 | |
| # Logging | |
| loguru==0.7.3 | |
| # Numeric deps | |
| numpy==1.26.4 | |
| ===================================================== | |
| render.yml - Render config | |
| ======= | |
| services: | |
| - type: web | |
| name: mike-v7-api | |
| env: docker | |
| dockerfilePath: ./Dockerfile | |
| region: singapore | |
| plan: free | |
| healthCheckPath: /health | |
| ===================================================== | |
| runtime.txt - Python version | |
| ======= | |
| python-3.11.6 | |
| ===================================================== | |
| Render Log Result after deploy | |
| ======= | |
| INFO: 183.171.99.126:0 - "GET /favicon.ico HTTP/1.1" 404 Not Found | |
| INFO: 183.171.99.126:0 - "GET / HTTP/1.1" 404 Not Found | |
| INFO: 35.197.37.4:0 - "GET / HTTP/1.1" 404 Not Found | |
| ==> /////////////////////////////////////////////////////////// | |
| ==> | |
| ==> Available at your primary URL https://mike-v7-mark1.onrender.com | |
| ==> | |
| ==> /////////////////////////////////////////////////////////// | |
| ==> | |
| ==> Your service is live ๐ | |
| INFO: 127.0.0.1:48210 - "HEAD / HTTP/1.1" 404 Not Found | |
| INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) | |
| INFO: Application startup complete. | |
| INFO: Waiting for application startup. | |
| INFO: Started server process [55] | |
| ==> Docs on specifying a port: https://render.com/docs/web-services#port-binding | |
| ==> No open ports detected, continuing to scan... | |
| ==> Running 'uvicorn app:app --host 0.0.0.0 --port 8000' | |
| ==> Deploying... | |
| ==> Build successful ๐ | |
| ==> Uploaded in 14.6s. Compression took 4.3s | |
| ==> Uploading build... | |
| [notice] To update, run: pip install --upgrade pip | |
| [notice] A new release of pip available: 22.3 -> 25.3 | |
| Successfully installed PyYAML-6.0.2 aiofiles-24.1.0 aiohappyeyeballs-2.6.1 aiohttp-3.11.11 aiosignal-1.4.0 annotated-types-0.7.0 anyio-4.11.0 attrs-25.4.0 beautifulsoup4-4.12.3 certifi-2025.11.12 cffi-2.0.0 charset-normalizer-3.4.4 click-8.3.1 cryptography-46.0.3 deprecation-2.1.0 fastapi-0.115.5 frozenlist-1.8.0 h11-0.16.0 h2-4.3.0 hpack-4.1.0 httpcore-1.0.9 httptools-0.7.1 httpx-0.28.1 hyperframe-6.1.0 idna-3.11 loguru-0.7.3 multidict-6.7.0 numpy-1.26.4 packaging-25.0 postgrest-2.24.0 propcache-0.4.1 psycopg2-binary-2.9.10 pycparser-2.23 pydantic-2.11.7 pydantic-core-2.33.2 pydantic-settings-2.7.1 pyjwt-2.10.1 python-dotenv-1.0.1 python-multipart-0.0.20 realtime-2.24.0 requests-2.32.3 sniffio-1.3.1 soupsieve-2.8 starlette-0.41.3 storage3-2.24.0 strenum-0.4.15 supabase-2.24.0 supabase-auth-2.24.0 supabase-functions-2.24.0 typing-extensions-4.15.0 typing-inspection-0.4.2 urllib3-2.5.0 uvicorn-0.34.0 uvloop-0.22.1 watchfiles-1.1.1 websockets-15.0.1 yarl-1.22.0 yt-dlp-2024.12.23 | |
| Installing collected packages: strenum, yt-dlp, websockets, uvloop, urllib3, typing-extensions, soupsieve, sniffio, PyYAML, python-multipart, python-dotenv, pyjwt, pycparser, psycopg2-binary, propcache, packaging, numpy, multidict, loguru, idna, hyperframe, httptools, hpack, h11, frozenlist, click, charset-normalizer, certifi, attrs, annotated-types, aiohappyeyeballs, aiofiles, yarl, uvicorn, typing-inspection, requests, pydantic-core, httpcore, h2, deprecation, cffi, beautifulsoup4, anyio, aiosignal, watchfiles, starlette, pydantic, httpx, cryptography, aiohttp, realtime, pydantic-settings, fastapi, supabase-functions, supabase-auth, storage3, postgrest, supabase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment