Skip to content

Self-improving AI Employees for everyone

fix: Use uv and pyproject.toml for Docker builds

trohitgf3d3b95fb5df
diff --git a/server/Dockerfile b/server/Dockerfile
index f29ae4e3..90cb0523 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -1,21 +1,20 @@
-# Python FastAPI Backend (CPU-only, no CUDA)
+# Python FastAPI Backend
FROM python:3.12-slim
WORKDIR /app
-# Install system dependencies
+# Install system dependencies and uv
RUN apt-get update && apt-get install -y \
curl \
gcc \
- && rm -rf /var/lib/apt/lists/*
+ && rm -rf /var/lib/apt/lists/* \
+ && pip install uv
-# Copy requirements first for better caching
-# Use requirements-docker.txt which excludes CUDA-heavy dependencies
-COPY requirements-docker.txt .
+# Copy dependency files first for better caching
+COPY pyproject.toml .
-# Install Python dependencies (CPU-only)
-# This avoids sentence-transformers/PyTorch CUDA which adds ~5GB to image
-RUN pip install --no-cache-dir -r requirements-docker.txt
+# Install Python dependencies using uv
+RUN uv pip install --system -e .
# Copy application code
COPY . .
@@ -24,19 +23,15 @@ COPY . .
RUN mkdir -p /app/data
# Compile Python files to optimized bytecode for faster imports
-# Keep .py files since Python imports require them or __pycache__/*.pyc
-# -O: optimize (remove assert statements)
-# -q: quiet mode
-# -f: force rebuild
RUN python -O -m compileall -q -f .
# Default port (overridden by environment)
ENV PORT=3010
-# Expose default port (actual port set via environment)
+# Expose default port
EXPOSE 3010
-# Health check using shell for variable expansion
+# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD sh -c "curl -f http://localhost:\${PORT}/health || exit 1"
diff --git a/server/requirements-docker.txt b/server/requirements-docker.txt
deleted file mode 100644
index 29209862..00000000
--- a/server/requirements-docker.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-# Docker-specific requirements (CPU-only, no CUDA)
-# This file is used by Dockerfile to avoid large CUDA dependencies
-
-# Core Framework
-fastapi>=0.110.0
-uvicorn[standard]>=0.27.0
-
-# Performance optimization
-uvloop>=0.19.0;sys_platform!='win32'
-orjson>=3.10.0
-
-# Database & ORM (Python 3.13 compatible versions)
-sqlmodel>=0.0.18
-sqlalchemy[asyncio]>=2.0.35
-aiosqlite>=0.20.0
-
-# Settings & Configuration
-pydantic>=2.6.0
-pydantic-settings>=2.2.0
-python-dotenv>=1.0.0
-
-# Dependency Injection
-dependency-injector>=4.41.0
-
-# Caching (Redis) - Python 3.13 compatible
-redis>=5.0.0
-
-# HTTP Client
-httpx>=0.27.0
-
-# WebSocket Client (for WhatsApp RPC)
-websockets>=12.0
-
-# Async HTTP Client (for Android relay WebSocket)
-aiohttp>=3.9.0
-
-# QR Code Generation (for WhatsApp QR display)
-qrcode[pil]>=7.4.0
-
-# Logging
-structlog>=23.2.0
-
-# AI Providers (LangChain) - compatible versions
-langchain-core>=1.2.6
-langchain-openai>=1.0.0
-langchain-anthropic>=1.3.0
-langchain-google-genai>=3.1.0
-langchain-groq>=0.1.0
-langchain-cerebras>=0.1.0
-
-# LangGraph - State machine for AI agents
-langgraph>=1.0.6
-
-# Temporal - Durable workflow execution (optional)
-temporalio>=1.21.1
-
-# Google Services
-googlemaps>=4.10.0
-
-# Scheduling
-APScheduler>=3.10.0
-
-# Web Search
-ddgs>=9.0.0
-
-# Authentication
-bcrypt>=4.1.0
-python-jose[cryptography]>=3.3.0
-email-validator>=2.0.0
-
-# Timezone support
-pytz>=2024.1
-
-# Document Processing (CPU-only)
-beautifulsoup4>=4.12.0
-langchain-text-splitters>=0.3.0
-pypdf>=4.0.0
-
-# Note: The following are excluded for Docker builds (CUDA/GPU heavy):
-# - sentence-transformers (pulls PyTorch with CUDA)
-# - langchain-huggingface (pulls sentence-transformers)
-# - chromadb (pulls sentence-transformers for embeddings)
-# - qdrant-client (optional, can be re-added if needed without embeddings)
-#
-# For production with embeddings, use external embedding APIs (OpenAI, etc.)
-# or build a separate GPU-enabled image.