fix: update Dockerfile to use pyproject.toml for dependencies
Some checks failed
Build and Push Monarch MCP Docker Image / build (push) Failing after 10s

Change from requirements.txt to pyproject.toml as source of truth for
dependencies. This ensures pyotp is properly installed in the Docker image
when built. Using 'uv pip install -e .' will install the package
with all dependencies from pyproject.toml.
This commit is contained in:
Ben
2025-12-24 21:41:04 +00:00
parent 6fc09d956f
commit 1d2bf199e1
3 changed files with 8 additions and 7 deletions

View File

@@ -6,11 +6,11 @@ WORKDIR /app
# Install uv for fast dependency management # Install uv for fast dependency management
RUN pip install uv RUN pip install uv
# Copy only requirements first to leverage Docker cache # Copy pyproject.toml first to leverage Docker cache
COPY requirements.txt . COPY pyproject.toml .
# Install dependencies into the system python environment of the builder # Install dependencies into system python environment of builder
RUN uv pip install --system -r requirements.txt RUN uv pip install --system -e .
# Stage 2: Final Image # Stage 2: Final Image
FROM python:3.12-slim FROM python:3.12-slim
@@ -31,11 +31,11 @@ COPY src/ ./src/
COPY pyproject.toml . COPY pyproject.toml .
COPY README.md . COPY README.md .
# Set Python path to find the package # Set Python path to find package
ENV PYTHONPATH=/app/src ENV PYTHONPATH=/app/src
# Default port # Default port
EXPOSE 8000 EXPOSE 8000
# Run the server # Run server
CMD ["python", "src/monarch_mcp_custom/server.py"] CMD ["python", "src/monarch_mcp_custom/server.py"]

View File

@@ -25,6 +25,7 @@ dependencies = [
"pydantic>=2.0.0", "pydantic>=2.0.0",
"starlette>=0.35.0", "starlette>=0.35.0",
"uvicorn>=0.27.0", "uvicorn>=0.27.0",
"pyotp>=2.9.0",
] ]
[project.scripts] [project.scripts]

View File

@@ -1,4 +1,3 @@
mcp[cli]>=1.0.0
fastmcp>=0.4.1 fastmcp>=0.4.1
monarchmoney>=0.1.15 monarchmoney>=0.1.15
gql>=3.4,<4.0 gql>=3.4,<4.0
@@ -6,3 +5,4 @@ python-dotenv>=1.0.0
pydantic>=2.0.0 pydantic>=2.0.0
starlette>=0.35.0 starlette>=0.35.0
uvicorn>=0.27.0 uvicorn>=0.27.0
pyotp==2.9.0