-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gateway
More file actions
36 lines (24 loc) · 802 Bytes
/
Dockerfile.gateway
File metadata and controls
36 lines (24 loc) · 802 Bytes
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
FROM rust:1.75-slim as builder
WORKDIR /build
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo build --release --bin beacon-gateway
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/beacon-gateway /usr/local/bin/
RUN useradd -m -u 1000 beacon && \
mkdir -p /var/lib/beacon && \
chown -R beacon:beacon /var/lib/beacon
USER beacon
WORKDIR /var/lib/beacon
EXPOSE 8545 8546 9090
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8545/health || exit 1
ENTRYPOINT ["beacon-gateway"]