This repository was archived by the owner on Mar 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements and install Python dependencies
COPY pyproject.toml ./
RUN pip install uv
RUN uv pip install --system fastmcp pydantic rich google-generativeai requests fastapi uvicorn numpy sqlite-vec
# Copy application code
COPY . .
# Create config from sample (users will need to set their API key)
RUN cp config.json.sample config.json
# Set default environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=8000
# Create directory for mounted volume
RUN mkdir -p /data
# Don't initialize database in build - it will be on mounted volume
# Expose MCP server port
EXPOSE 8000
# Create an entrypoint script to handle database initialization
RUN echo '#!/bin/bash\n\
if [ ! -f "/data/signals_agent.db" ]; then\n\
echo "Initializing database..."\n\
python database.py\n\
fi\n\
exec "$@"' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
# Use entrypoint to ensure database exists
ENTRYPOINT ["/app/entrypoint.sh"]
# Default command runs FastMCP server with HTTP transport at /mcp/
CMD ["fastmcp", "run", "main.py", "--transport", "http", "--host", "0.0.0.0", "--port", "8000", "--path", "/mcp/"]