-
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (38 loc) · 1.84 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (38 loc) · 1.84 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
# Stage 1: build
# python:3.13-slim
FROM python:3.13-slim@sha256:b04b5d7233d2ad9c379e22ea8927cd1378cd15c60d4ef876c065b25ea8fb3bf3 AS build
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir hatchling==1.29.0 && \
python -m hatchling build
# Stage 2: runtime
# python:3.13-slim
FROM python:3.13-slim@sha256:b04b5d7233d2ad9c379e22ea8927cd1378cd15c60d4ef876c065b25ea8fb3bf3
LABEL org.opencontainers.image.title="bernstein" \
org.opencontainers.image.description="Declarative agent orchestration for engineering teams" \
org.opencontainers.image.source="https://github.com/bernstein-ai/bernstein"
# Install git (required for git_ops) and curl (healthcheck)
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY --from=build /app/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl && \
useradd -m -u 1000 bernstein && chown bernstein:bernstein /workspace
USER bernstein
# Bernstein state directory (mount a volume here for persistence)
VOLUME ["/workspace/.sdd"]
# Task server HTTP + gRPC ports
EXPOSE 8052 50051
# Probe the task server health endpoint. Override via docker-compose / Helm for
# components that do not expose HTTP (e.g. worker-only deployments) by passing
# `--health-cmd=NONE` or replacing this with the component-specific check.
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD curl --fail --silent --show-error http://127.0.0.1:8052/health || exit 1
# Default: all-in-one mode (reads bernstein.yaml, starts server + agents)
# Override CMD in docker-compose / Helm to run individual components:
# Server only: python -m uvicorn bernstein.core.server:app --host 0.0.0.0 --port 8052
# Orchestrator: python -m bernstein.core.orchestrator
ENTRYPOINT ["bernstein"]
CMD ["conduct"]