-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bridge
More file actions
66 lines (53 loc) · 2.37 KB
/
Copy pathDockerfile.bridge
File metadata and controls
66 lines (53 loc) · 2.37 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
65
66
# Dockerfile.bridge — Channel Bridge (dojo-bridge binary)
# Builds ./cmd/dojo/ which produces the bridge entrypoint.
# Must mirror go.work module layout for dependency caching.
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Copy workspace and root module files
COPY go.work go.work.sum* ./
COPY go.mod go.sum ./
# Copy each workspace module's go.mod/go.sum for dependency caching.
# This list must match the `use` block in go.work.
COPY apps/go.mod apps/go.sum* ./apps/
COPY cmd/dojo/go.mod cmd/dojo/go.sum* ./cmd/dojo/
COPY disposition/go.mod disposition/go.sum* ./disposition/
COPY integration/go.mod integration/go.sum* ./integration/
COPY mcp/go.mod mcp/go.sum* ./mcp/
COPY memory/go.mod memory/go.sum* ./memory/
COPY orchestration/go.mod orchestration/go.sum* ./orchestration/
COPY provider/go.mod provider/go.sum* ./provider/
COPY runtime/actor/go.mod runtime/actor/go.sum* ./runtime/actor/
COPY runtime/cas/go.mod runtime/cas/go.sum* ./runtime/cas/
COPY runtime/d1client/go.mod runtime/d1client/go.sum* ./runtime/d1client/
COPY runtime/event/go.mod runtime/event/go.sum* ./runtime/event/
COPY runtime/wasm/go.mod runtime/wasm/go.sum* ./runtime/wasm/
COPY server/go.mod server/go.sum* ./server/
COPY skill/go.mod skill/go.sum* ./skill/
COPY tools/go.mod tools/go.sum* ./tools/
COPY wasm-modules/dip-scorer/go.mod wasm-modules/dip-scorer/go.sum* ./wasm-modules/dip-scorer/
COPY workflow/go.mod workflow/go.sum* ./workflow/
# Download dependencies for all workspace modules
RUN for dir in apps cmd/dojo disposition integration mcp memory \
orchestration provider runtime/actor runtime/cas runtime/d1client \
runtime/event runtime/wasm server skill tools \
wasm-modules/dip-scorer workflow; do \
cd /app/$dir && go mod download; \
done
# Copy full source tree
COPY . .
# Create data dir for runtime volume ownership
RUN mkdir -p /app/data
# Build bridge binary only
RUN CGO_ENABLED=0 go build \
-ldflags="-s -w" \
-o /dojo-bridge ./cmd/dojo/
# Runtime stage — distroless for minimal attack surface
FROM gcr.io/distroless/static-debian12
COPY --from=builder /dojo-bridge /dojo-bridge
# Pre-create data dir owned by nobody so Docker named volumes inherit
# correct permissions on first mount (no root override needed).
COPY --from=builder --chown=65534:65534 /app/data /app/data
EXPOSE 8090
# Run as non-root user (nobody)
USER 65534:65534
ENTRYPOINT ["/dojo-bridge", "bridge"]