-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 827 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 827 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
FROM golang:1.26-bookworm AS builder
WORKDIR /ev-node
COPY go.mod go.sum ./
COPY apps/grpc/go.mod apps/grpc/go.sum ./apps/grpc/
COPY core/go.mod core/go.sum ./core/
COPY execution/grpc/go.mod execution/grpc/go.sum ./execution/grpc/
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
RUN mkdir -p /home/ev-node
RUN --mount=type=cache,target=/go/pkg/mod \
cd ./apps/grpc && \
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w" -o /out/evgrpc .
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder --chown=10001:10001 /home/ev-node /home/ev-node
WORKDIR /home/ev-node
COPY --from=builder /out/evgrpc /usr/local/bin/evgrpc
USER 10001:10001
EXPOSE 26656
EXPOSE 26657
EXPOSE 26660
ENTRYPOINT ["/usr/local/bin/evgrpc"]
CMD ["start"]