feat: add Dockerfile and .dockerignore for containerized deployment
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
# Git and environments
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.venv
|
||||||
|
venv
|
||||||
|
env
|
||||||
|
|
||||||
|
# Python caches
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
.Python
|
||||||
|
|
||||||
|
# Local environments and secrets
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
|
||||||
|
# Linting and testing
|
||||||
|
.ruff_cache
|
||||||
|
.pytest_cache
|
||||||
|
tests/
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
*.egg-info/
|
||||||
|
scratch/
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
# Use the official uv image for fast Python builds
|
||||||
|
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Enable bytecode compilation
|
||||||
|
ENV UV_COMPILE_BYTECODE=1
|
||||||
|
|
||||||
|
# Copy the lockfile and pyproject.toml
|
||||||
|
COPY uv.lock pyproject.toml /app/
|
||||||
|
|
||||||
|
# Install dependencies (without the project itself) for caching
|
||||||
|
RUN uv sync --frozen --no-install-project --no-dev
|
||||||
|
|
||||||
|
# Copy the source code and README (required by hatchling for metadata)
|
||||||
|
COPY src /app/src/
|
||||||
|
COPY README.md /app/
|
||||||
|
|
||||||
|
# Install the project
|
||||||
|
RUN uv sync --frozen --no-dev
|
||||||
|
|
||||||
|
# Make the executable available in the path
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
# Run the MCP server
|
||||||
|
# By default, strava-mcp uses fastmcp.run() which exposes stdio.
|
||||||
|
# If you want to run it as an SSE server, you might need to adjust the command.
|
||||||
|
# For now, we just call the main entrypoint.
|
||||||
|
ENTRYPOINT ["strava-mcp"]
|
||||||
Reference in New Issue
Block a user