-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.28 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (32 loc) · 1.28 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
# Use Python 3.12 slim image for smaller size
FROM python:3.12-slim
# Note: .dockerignore is symlinked to .gitignore for unified exclusion rules
# Set working directory
WORKDIR /app
# Install uv for faster dependency management
# https://github.com/astral-sh/uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_SYSTEM_PYTHON=1
# Copy dependency files and README first for better layer caching
COPY pyproject.toml README.md ./
# Copy the application source code (needed for editable install)
COPY src/ ./src/
# Install dependencies using uv
RUN uv pip install -e .
# Copy test files (optional, for testing in container)
COPY tests/ ./tests/
COPY pytest.ini ./
# Create directory for Garmin tokens
RUN mkdir -p /root/.garminconnect && \
chmod 700 /root/.garminconnect
# Expose the HTTP port. The image defaults to stdio (Claude Desktop, Inspector);
# set GARMIN_MCP_TRANSPORT=streamable-http to serve over this port (e.g. in k8s).
# EXPOSE 8000
# Set the entrypoint to run the MCP server
ENTRYPOINT ["garmin-mcp"]
# Health check (optional - adjust based on your needs)
# HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
# CMD python -c "import sys; sys.exit(0)"