Add Docker support and fix external access issues
🐳 Docker Configuration: - Created Dockerfile for containerized API deployment - Added docker-compose.api.yml for complete stack - Added requirements.txt for Docker builds - Added .dockerignore for optimized builds - Configured external access on 0.0.0.0:8080 📚 Documentation Updates: - Updated quickstart to reflect Neo4j already running - Added Docker deployment tabs with external access info - Updated REST API docs with Docker deployment options - Clarified local vs external access deployment methods 🔧 Configuration: - API_HOST=0.0.0.0 for external access in Docker - Health checks and restart policies - Proper networking and volume configuration - Environment variable configuration ✅ Addresses user issues: - REST API now accessible from outside the machine via Docker - Documentation reflects actual infrastructure state - Clear deployment options for different use cases 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
49
Dockerfile
Normal file
49
Dockerfile
Normal file
@@ -0,0 +1,49 @@
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
g++ \
|
||||
&& 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"]
|
||||
Reference in New Issue
Block a user