-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 2.15 KB
/
Copy pathDockerfile
File metadata and controls
63 lines (49 loc) · 2.15 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
# ──────────────────────────────────────────────
# Stage 1: Build
# ──────────────────────────────────────────────
FROM rust:1.88-bookworm AS builder
WORKDIR /app
# Install musl tools for static linking (optional, for smaller images)
RUN apt-get update && apt-get install -y --no-install-recommends \
musl-tools \
&& rm -rf /var/lib/apt/lists/*
# Copy workspace manifests first for layer caching
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY binary ./binary
COPY orchestration ./orchestration
# Build release binaries
RUN cargo build --release -p openflows
# ──────────────────────────────────────────────
# Stage 2: Runtime
# ──────────────────────────────────────────────
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
# Install Claude Code CLI globally
RUN npm install -g @anthropic-ai/claude-code
# Create non-root user
RUN groupadd -r openflows && useradd -r -g openflows -m -d /home/openflows openflows
# Copy binaries from builder
COPY --from=builder /app/target/release/openflows /usr/local/bin/
COPY --from=builder /app/target/release/openflows-setup /usr/local/bin/
COPY --from=builder /app/target/release/openflows-dashboard /usr/local/bin/
COPY --from=builder /app/target/release/openflows-doctor /usr/local/bin/
# Set permissions
RUN chmod +x /usr/local/bin/openflows*
# Create workspace directory
RUN mkdir -p /workspace && chown -R openflows:openflows /workspace
# Switch to non-root user
USER openflows
WORKDIR /workspace
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD pgrep -x openflows > /dev/null || exit 1
ENTRYPOINT ["openflows"]
CMD ["--help"]