/ docker / Dockerfile
Dockerfile
 1  FROM python:3.11-slim
 2  
 3  WORKDIR /app
 4  
 5  # Install system dependencies
 6  RUN apt-get update && apt-get install -y --no-install-recommends \
 7      gcc \
 8      python3-dev \
 9      curl \
10      git \
11      && rm -rf /var/lib/apt/lists/*
12  
13  # Create praison config directory
14  RUN mkdir -p /root/.praison
15  
16  # Install Python packages (using latest versions)
17  # Note: praisonai is installed from PyPI - remove version pin to use latest available
18  RUN pip install --no-cache-dir \
19      flask \
20      praisonai \
21      "praisonai[api]" \
22      gunicorn \
23      markdown
24  
25  # Copy application code
26  COPY . .
27  
28  # Set environment variables for directory management
29  ENV PRAISON_CONFIG_DIR=/root/.praison
30  ENV DOCKER_CONTAINER=true
31  
32  # Create health check API if api.py doesn't exist
33  RUN if [ ! -f api.py ]; then \
34      echo "from flask import Flask\n\
35  app = Flask(__name__)\n\
36  \n\
37  @app.route('/health')\n\
38  def health():\n\
39      return {'status': 'healthy'}, 200\n\
40  \n\
41  if __name__ == '__main__':\n\
42      app.run()" > api.py; \
43  fi
44  
45  EXPOSE 8080
46  CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]