feat: add Dockerfile and .dockerignore for containerized deployment

This commit is contained in:
2026-05-09 01:18:53 +02:00
parent bb7be30c2b
commit b43e83758c
2 changed files with 58 additions and 0 deletions
+28
View File
@@ -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
View File
@@ -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"]