Skip to content

Commit b1af96f

Browse files
Merge pull request #545 from MervinPraison/claude/issue-130-20250530_105428
feat: implement comprehensive Docker support and package publishing for issue #130
2 parents 30552c3 + 298d62f commit b1af96f

11 files changed

Lines changed: 996 additions & 15 deletions

docker/.env.template

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# PraisonAI Docker Environment Configuration
2+
# Copy this file to .env and update with your values
3+
4+
# Required: OpenAI API Key
5+
OPENAI_API_KEY=your_openai_api_key_here
6+
7+
# Required: Chainlit Authentication Secret (generate a random string)
8+
CHAINLIT_AUTH_SECRET=your_chainlit_secret_here
9+
10+
# Optional: Additional API Keys
11+
ANTHROPIC_API_KEY=your_anthropic_api_key_here
12+
GOOGLE_API_KEY=your_google_api_key_here
13+
GROQ_API_KEY=your_groq_api_key_here
14+
COHERE_API_KEY=your_cohere_api_key_here
15+
16+
# Optional: Service Configuration
17+
FLASK_ENV=development
18+
CHAINLIT_HOST=0.0.0.0
19+
20+
# Optional: Port Configuration (modify if you have conflicts)
21+
UI_PORT=8082
22+
CHAT_PORT=8083
23+
API_PORT=8080
24+
25+
# Optional: Database Configuration
26+
DATABASE_URL=sqlite:///root/.praison/database.sqlite
27+
28+
# Optional: Logging Configuration
29+
LOG_LEVEL=INFO
30+
PYTHONPATH=/app
31+
32+
# Optional: Development Settings
33+
DEV_MODE=false
34+
DEBUG=false
35+
36+
# Optional: Model Configuration
37+
DEFAULT_MODEL=gpt-4
38+
DEFAULT_TEMPERATURE=0.7
39+
MAX_TOKENS=4000
40+
41+
# Optional: Security Settings
42+
CORS_ORIGINS=http://localhost:3000,http://localhost:8082,http://localhost:8083
43+
RATE_LIMIT=100
44+
45+
# Optional: Feature Flags
46+
ENABLE_CHAT=true
47+
ENABLE_UI=true
48+
ENABLE_API=true
49+
ENABLE_REALTIME=true
50+
51+
# Optional: Volume Paths (for custom mounting)
52+
PRAISON_DATA_PATH=~/.praison
53+
EXAMPLES_PATH=./examples

docker/Dockerfile

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
FROM python:3.11-slim
2+
23
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+
RUN pip install --no-cache-dir \
18+
flask \
19+
"praisonai>=2.2.19" \
20+
"praisonai[api]" \
21+
praisonaiagents>=0.0.92 \
22+
gunicorn \
23+
markdown
24+
25+
# Copy application code
326
COPY . .
4-
RUN pip install flask praisonai==2.2.19 gunicorn markdown
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+
545
EXPOSE 8080
646
CMD ["gunicorn", "-b", "0.0.0.0:8080", "api:app"]

docker/Dockerfile.chat

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
77
gcc \
88
python3-dev \
99
curl \
10+
git \
1011
&& rm -rf /var/lib/apt/lists/*
1112

12-
# Install Python packages
13+
# Create praison config directory
14+
RUN mkdir -p /root/.praison
15+
16+
# Install Python packages (using latest versions)
1317
RUN pip install --no-cache-dir \
14-
praisonaiagents>=0.0.4 \
18+
praisonaiagents>=0.0.92 \
1519
praisonai_tools \
16-
"praisonai==2.2.19" \
20+
"praisonai>=2.2.19" \
1721
"praisonai[chat]" \
1822
"embedchain[github,youtube]"
1923

2024
# Copy application code
2125
COPY . .
2226

27+
# Set environment variables for directory management
28+
ENV PRAISON_CONFIG_DIR=/root/.praison
29+
ENV CHAINLIT_CONFIG_DIR=/root/.praison
30+
ENV CHAINLIT_DB_DIR=/root/.praison
31+
ENV DOCKER_CONTAINER=true
32+
2333
# Default command (will be overridden by docker-compose)
2434
CMD ["praisonai", "chat"]

docker/Dockerfile.dev

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,40 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
99
portaudio19-dev \
1010
python3-pyaudio \
1111
curl \
12+
git \
13+
vim \
14+
nano \
1215
&& rm -rf /var/lib/apt/lists/*
1316

14-
# Install Python packages
17+
# Create praison config directory
18+
RUN mkdir -p /root/.praison
19+
20+
# Install Python packages (using latest versions)
1521
RUN pip install --no-cache-dir \
16-
praisonaiagents>=0.0.4 \
22+
praisonaiagents>=0.0.92 \
1723
praisonai_tools \
18-
"praisonai==2.2.19" \
24+
"praisonai>=2.2.19" \
1925
"praisonai[ui]" \
2026
"praisonai[chat]" \
2127
"praisonai[realtime]" \
22-
"embedchain[github,youtube]"
28+
"praisonai[code]" \
29+
"embedchain[github,youtube]" \
30+
jupyter \
31+
jupyterlab \
32+
notebook \
33+
pytest \
34+
pytest-asyncio \
35+
mkdocs \
36+
mkdocs-material
2337

2438
# Copy application code
2539
COPY . .
2640

41+
# Set environment variables for directory management
42+
ENV PRAISON_CONFIG_DIR=/root/.praison
43+
ENV CHAINLIT_CONFIG_DIR=/root/.praison
44+
ENV CHAINLIT_DB_DIR=/root/.praison
45+
ENV DOCKER_CONTAINER=true
46+
2747
# Default command (will be overridden by docker-compose)
2848
CMD ["praisonai", "ui"]

docker/Dockerfile.praisonaiagents

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# Copy praisonaiagents source
17+
COPY src/praisonai-agents/ /app/praisonaiagents/
18+
WORKDIR /app/praisonaiagents
19+
20+
# Install praisonaiagents with all features (non-editable for production)
21+
RUN pip install --no-cache-dir ".[all]"
22+
23+
# Set environment variables for directory management
24+
ENV PRAISON_CONFIG_DIR=/root/.praison
25+
ENV CHAINLIT_CONFIG_DIR=/root/.praison
26+
ENV CHAINLIT_DB_DIR=/root/.praison
27+
ENV DOCKER_CONTAINER=true
28+
29+
WORKDIR /app
30+
31+
# Default command
32+
CMD ["python", "-c", "import praisonaiagents; print('PraisonAI Agents installed successfully')"]

docker/Dockerfile.ui

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
77
gcc \
88
python3-dev \
99
curl \
10+
git \
1011
&& rm -rf /var/lib/apt/lists/*
1112

12-
# Install Python packages
13+
# Create praison config directory
14+
RUN mkdir -p /root/.praison
15+
16+
# Install Python packages (using latest versions)
1317
RUN pip install --no-cache-dir \
14-
praisonaiagents>=0.0.4 \
18+
praisonaiagents>=0.0.92 \
1519
praisonai_tools \
16-
"praisonai==2.2.19" \
20+
"praisonai>=2.2.19" \
1721
"praisonai[ui]" \
1822
"praisonai[crewai]"
1923

2024
# Copy application code
2125
COPY . .
2226

27+
# Set environment variables for directory management
28+
ENV PRAISON_CONFIG_DIR=/root/.praison
29+
ENV CHAINLIT_CONFIG_DIR=/root/.praison
30+
ENV CHAINLIT_DB_DIR=/root/.praison
31+
ENV DOCKER_CONTAINER=true
32+
2333
# Default command (will be overridden by docker-compose)
2434
CMD ["praisonai", "ui"]

0 commit comments

Comments
 (0)