This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (34 loc) · 1.5 KB
/
Dockerfile
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
# |==============================[ rapidsnark build stage ]=============================================|
# Build stage for rapidsnark
FROM node:16-buster-slim as rapidsnark-builder
# update global dependencies & add rapidsnark build dependencies
RUN apt-get update && apt-get install -y git curl build-essential libgmp-dev libsodium-dev nasm
# Build iden3/rapidsnark source
RUN git clone https://github.com/iden3/rapidsnark.git && \
cd rapidsnark && \
git submodule init && \
git submodule update && \
npm install && \
npx task createFieldSources && \
npx task buildProver
# |=================================[ sealer build stage ]===============================================|
# Build stage for unirep source (custom branch checkout)
FROM node:16-buster-slim as sealer-builder
# update global dependencies & add build dependencies
RUN apt-get update && apt-get install -y git build-essential curl wget
# Copy from local source
COPY . /src
WORKDIR /src
RUN yarn
# Load unirep beta
RUN sh scripts/loadUnirepBeta.sh
# Load proving keys
RUN sh scripts/loadKeys.sh
# |=================================[ final stage ]===============================================|
FROM node:16-buster-slim as daemon
RUN apt-get update && apt-get install -y libsodium-dev libgmp-dev libgomp1
# Copy canon from canon-builder stage
COPY --from=sealer-builder /src /src
# Copy rapidsnark from rapidsnark-builder stage
COPY --from=rapidsnark-builder /rapidsnark/build/prover /bin/rapidsnark
CMD ["node", "/src/src/daemon.mjs"]