-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (47 loc) · 1.93 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (47 loc) · 1.93 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
52
53
54
55
56
57
58
59
60
61
62
63
64
# syntax=docker/dockerfile:1
FROM python:3.11-slim AS builder
WORKDIR /build
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml README.md ./
COPY metis ./metis
RUN pip install --no-cache-dir --upgrade pip \
&& pip wheel --no-cache-dir --wheel-dir /wheels ".[distributed]"
# -----------------------------------------------------------------------------
FROM python:3.11-slim AS runtime
LABEL org.opencontainers.image.title="metis" \
org.opencontainers.image.description="Multi-agent reasoning orchestrator" \
org.opencontainers.image.source="https://github.com/metis/metis"
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
METIS_PRODUCTION=true \
METIS_LOG_LEVEL=INFO \
METIS_LOG_FORMAT=json \
METIS_LOG_CONTENT=redacted \
PATH="/app/.local/bin:$PATH"
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --gid 1000 metis \
&& useradd --uid 1000 --gid metis --create-home --shell /usr/sbin/nologin metis
COPY --from=builder /wheels /wheels
RUN pip install --no-cache-dir /wheels/* \
&& rm -rf /wheels
COPY metis ./metis
COPY config ./config
COPY scripts/docker-entrypoint-coordinator.sh scripts/docker-entrypoint-node.sh ./scripts/
RUN chmod +x ./scripts/docker-entrypoint-*.sh \
&& mkdir -p /data/memory /data/config /data/logs /data/traces \
&& chown -R metis:metis /app /data
USER metis
EXPOSE 8080 8443 8444
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD curl -sf http://127.0.0.1:${METIS_COORDINATOR_PORT:-8080}/health \
|| curl -sf http://127.0.0.1:${METIS_NODE_PORT:-8443}/metis/health \
-H "Authorization: Bearer ${METIS_NODE_A_KEY:-${METIS_NODE_B_KEY:-}}" \
|| exit 1
# Default CMD overridden per service in compose
CMD ["metis-coordinator", "--production"]