-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 811 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (24 loc) · 811 Bytes
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
# Pin base image to specific version tag for reproducible builds
FROM python:3.12-slim AS builder
WORKDIR /build
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir --prefix=/install .
# --- Final stage ---
FROM python:3.12-slim
WORKDIR /app
# Copy installed packages from builder
COPY --from=builder /install /usr/local
# Copy default configs
COPY config/ /app/config/
# Create non-root user
RUN useradd --create-home --shell /bin/bash appuser
USER appuser
ENV MCP_TRANSPORT=streamable-http
ENV MCP_HOST=0.0.0.0
ENV MCP_PORT=8080
ENV CONFIG_DIR=/app/config
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python -c "import socket; s=socket.create_connection(('localhost', 8080), 5); s.close()" || exit 1
CMD ["python", "-m", "odoo_mcp_gateway"]