-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (50 loc) · 1.69 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (50 loc) · 1.69 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Dockerfile for Maverick-MCP
# Python-only MCP server
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies, Chromium for Kaleido v1 image export, and TA-Lib
RUN apt-get update && apt-get install -yqq --no-install-recommends \
build-essential \
ca-certificates \
chromium \
curl \
fonts-liberation \
libpq-dev \
python3-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install uv for fast Python package management
RUN pip install --no-cache-dir uv
# Install and compile TA-Lib
ENV TALIB_DIR=/usr/local
RUN wget https://github.com/ta-lib/ta-lib/releases/download/v0.6.4/ta-lib-0.6.4-src.tar.gz \
&& tar -xzf ta-lib-0.6.4-src.tar.gz \
&& cd ta-lib-0.6.4/ \
&& ./configure --prefix=$TALIB_DIR \
&& make -j$(nproc) \
&& make install \
&& cd .. \
&& rm -rf ta-lib-0.6.4-src.tar.gz ta-lib-0.6.4/
# Copy dependency files first for better caching
COPY pyproject.toml uv.lock README.md ./
# Install Python dependencies
RUN uv sync --frozen
# Copy application code
COPY maverick_mcp ./maverick_mcp
COPY alembic ./alembic
COPY alembic.ini setup.py ./
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV BROWSER_PATH=/usr/bin/chromium
# Create non-root user
RUN groupadd -g 1000 maverick && \
useradd -u 1000 -g maverick -s /bin/sh -m maverick && \
chown -R maverick:maverick /app
USER maverick
EXPOSE 8000
# Health check for container orchestration (Docker, ECS, Kubernetes)
HEALTHCHECK --interval=30s --timeout=10s --start-period=45s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Start MCP server
CMD ["uv", "run", "python", "-m", "maverick_mcp.api.server", "--transport", "sse", "--host", "0.0.0.0", "--port", "8000"]