-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.39 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (37 loc) · 1.39 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
# Stage 1: Build all binaries
FROM golang:1.26-alpine AS builder
WORKDIR /build
# Cache dependencies first
COPY go.mod ./
RUN go mod download
# Copy source
COPY . .
# Build main node binary
RUN go build -o rainstorm .
# Build CLI job-submission tool
RUN go build -o rainstorm-cli cmd/cli/main.go
# Build all stream operators
RUN for op in grep count transform identity echo output; do \
cd ops/$op && go build -o $op . && cd /build; \
done
# Stage 2: Minimal runtime image
FROM alpine:3.19
WORKDIR /app
# Copy binaries from builder
COPY --from=builder /build/rainstorm ./rainstorm
COPY --from=builder /build/rainstorm-cli ./rainstorm-cli
# Copy operators into expected directory structure
RUN mkdir -p ops/grep ops/count ops/transform ops/identity ops/echo ops/output
COPY --from=builder /build/ops/grep/grep ops/grep/grep
COPY --from=builder /build/ops/count/count ops/count/count
COPY --from=builder /build/ops/transform/transform ops/transform/transform
COPY --from=builder /build/ops/identity/identity ops/identity/identity
COPY --from=builder /build/ops/echo/echo ops/echo/echo
COPY --from=builder /build/ops/output/output ops/output/output
# Copy config and data
COPY config.json ./
COPY data/ ./data/
# Create directories used at runtime
RUN mkdir -p logs rainstorm_outputs hydfs_storage
# Default: run the node server
CMD ["./rainstorm"]