Files
t6_mem0/Dockerfile
Docker Config Backup 0f99abaebc Fix Docker networking for external API access
🔧 Docker Configuration Updates:
- Updated docker-compose.api.yml to use host networking
- Added curl to Dockerfile for health checks
- Removed unnecessary Neo4j service (already running)
- Simplified container configuration for external access

 External Access Confirmed:
- API accessible on 0.0.0.0:8080 from outside the machine
- Health endpoint working: /health
- Authenticated endpoints working: /status
- All services connected and healthy

📊 Deployment Status:
- Docker image built successfully (610MB)
- Container running with mem0-api-server name
- Host networking enables external connectivity
- Ollama and Supabase connections working

🎯 User Issue Resolved:
- REST API now accessible from outside the machine
- Docker deployment provides production-ready external access
- Documentation updated to reflect correct deployment methods

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 17:45:52 +02:00

50 lines
1.0 KiB
Docker

FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt* ./
RUN pip install --no-cache-dir \
fastapi \
uvicorn \
posthog \
qdrant-client \
sqlalchemy \
vecs \
ollama \
mem0ai \
requests \
httpx
# Copy application code
COPY . .
# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
# Expose port
EXPOSE 8080
# Environment variables with defaults
ENV API_HOST=0.0.0.0
ENV API_PORT=8080
ENV API_KEYS=mem0_dev_key_123456789,mem0_docker_key_987654321
ENV ADMIN_API_KEYS=mem0_admin_key_111222333
ENV RATE_LIMIT_REQUESTS=100
ENV RATE_LIMIT_WINDOW_MINUTES=1
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Start the API server
CMD ["python", "start_api.py"]