/ docker / Dockerfile.serve
Dockerfile.serve
 1  # Dockerfile for PraisonAI Serve API
 2  # Deploy to Railway, Render, Fly.io, or any container platform
 3  #
 4  # Build: docker build -f Dockerfile.serve -t praisonai-serve .
 5  # Run:   docker run -p 8005:8005 -e OPENAI_API_KEY=sk-xxx praisonai-serve
 6  
 7  FROM python:3.11-slim
 8  
 9  WORKDIR /app
10  
11  # Install dependencies
12  RUN pip install --no-cache-dir praisonai praisonaiagents
13  
14  # Copy agents configuration
15  COPY agents.yaml .
16  
17  # Expose the API port
18  EXPOSE 8005
19  
20  # Health check
21  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
22      CMD curl -f http://localhost:8005/health || exit 1
23  
24  # Start the API server
25  CMD ["praisonai", "serve", "agents.yaml", "--host", "0.0.0.0", "--port", "8005"]