-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.coordinator
More file actions
52 lines (36 loc) · 1.01 KB
/
Dockerfile.coordinator
File metadata and controls
52 lines (36 loc) · 1.01 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
# Build stage
FROM rust:1.75 as builder
WORKDIR /usr/src/bitsage-node
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy source code
COPY src ./src
COPY examples ./examples
# Build the coordinator binary
RUN cargo build --release --bin sage-coordinator
# Runtime stage
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
libpq5 \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create app user
RUN useradd -m -u 1000 bitsage
WORKDIR /app
# Copy binary from builder
COPY --from=builder /usr/src/bitsage-node/target/release/sage-coordinator /app/coordinator
# Copy configuration
COPY config /app/config
# Set ownership
RUN chown -R bitsage:bitsage /app
USER bitsage
# Expose ports
EXPOSE 8080 9000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run coordinator
CMD ["./coordinator", "--config", "/app/config/coordinator.toml"]