-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
51 lines (39 loc) · 1.11 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
45
46
47
48
49
50
51
FROM python:3.13-alpine
# Install system dependencies
RUN apk add --no-cache \
curl \
build-base \
gcc \
musl-dev \
libffi-dev \
openssl-dev
# Install UV for fast dependency management
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
cp /root/.local/bin/uv /usr/local/bin/uv && \
chmod +x /usr/local/bin/uv
WORKDIR /app
# Copy project files
COPY pyproject.toml ./
COPY uv.lock ./
COPY README.md ./
# Install Python dependencies with UV
RUN uv sync --frozen --no-dev
# Copy source code
COPY server.py ./
# Create non-root user with specific UID
RUN adduser -D -u 1000 appuser
# Change ownership of the app directory to appuser
RUN chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Set environment variables
ENV GOOGLE_SEARCH_ENGINE_ID=
ENV GOOGLE_SERVICE_ACCOUNT_FILE=
ENV GOOGLE_SERVICE_ACCOUNT_BASE64=
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV PATH="/app/.venv/bin:${PATH}"
# Expose MCP server port
EXPOSE 3000
# Run the MCP server in HTTP mode for container deployment
CMD ["python", "server.py", "--transport", "http", "--host", "0.0.0.0", "--port", "3000"]