-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 913 Bytes
/
Dockerfile
File metadata and controls
33 lines (21 loc) · 913 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
# Stage 1: Build SNS Worker
FROM ghcr.io/zama-ai/fhevm/gci/rust-glibc:1.91.0 AS builder
ARG CARGO_PROFILE=release
USER root
WORKDIR /app
COPY coprocessor/fhevm-engine ./coprocessor/fhevm-engine
COPY coprocessor/proto ./coprocessor/proto
COPY gateway-contracts/rust_bindings ./gateway-contracts/rust_bindings
WORKDIR /app/coprocessor/fhevm-engine
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
cargo fetch && \
SQLX_OFFLINE=true cargo build --profile=${CARGO_PROFILE} -p sns-worker
# Stage 2: Runtime image
FROM cgr.dev/zama.ai/glibc-dynamic:15.2.0 AS prod
ARG CARGO_PROFILE=release
COPY --from=builder /etc/group /etc/group
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder --chown=fhevm:fhevm /app/coprocessor/fhevm-engine/target/${CARGO_PROFILE}/sns_worker /usr/local/bin/sns_worker
USER fhevm:fhevm
CMD ["/usr/local/bin/sns_worker"]
FROM prod AS dev