Files
google-mcp/Dockerfile

46 lines
1.2 KiB
Docker
Raw Normal View History

2025-06-11 18:40:08 -04:00
FROM python:3.11-slim
2025-05-14 10:46:01 -04:00
2025-06-11 18:40:08 -04:00
WORKDIR /app
2025-05-17 13:18:46 -04:00
2025-06-11 18:40:08 -04:00
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
2025-05-14 10:46:01 -04:00
2025-06-11 18:40:08 -04:00
# Install uv for faster dependency management
RUN pip install --no-cache-dir uv
2025-08-06 09:33:09 -04:00
COPY . .
2025-06-11 18:40:08 -04:00
2025-08-06 09:33:09 -04:00
# Install Python dependencies using uv sync
2026-03-09 12:52:00 -04:00
RUN uv sync --frozen --no-dev --extra disk
2026-03-09 12:47:40 -04:00
2025-06-11 18:40:08 -04:00
# Create non-root user for security
RUN useradd --create-home --shell /bin/bash app \
&& chown -R app:app /app
2025-06-07 18:49:54 -04:00
# Give read and write access to the store_creds volume
RUN mkdir -p /app/store_creds \
&& chown -R app:app /app/store_creds \
&& chmod 755 /app/store_creds
USER app
2025-06-11 18:40:08 -04:00
# Expose port (use default of 8000 if PORT not set)
EXPOSE 8000
2025-07-05 15:59:39 -04:00
# Expose additional port if PORT environment variable is set to a different value
ARG PORT
EXPOSE ${PORT:-8000}
2025-06-07 18:49:54 -04:00
2025-06-11 18:40:08 -04:00
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD sh -c 'curl -f http://localhost:${PORT:-8000}/health || exit 1'
2025-06-07 19:17:53 -04:00
2025-08-19 16:31:08 -04:00
# Set environment variables for Python startup args
ENV TOOL_TIER=""
ENV TOOLS=""
2025-08-19 16:35:06 -04:00
# Use entrypoint for the base command and CMD for args
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["uv run main.py --transport streamable-http ${TOOL_TIER:+--tool-tier \"$TOOL_TIER\"} ${TOOLS:+--tools $TOOLS}"]