Skip to content

Commit 3930184

Browse files
Refactor Dockerfile and update README for key management (#1743)
1 parent 2d50663 commit 3930184

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

prover/server/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.3-alpine as builder
1+
FROM golang:1.20.3-alpine AS builder
22

33
WORKDIR /app
44

@@ -10,10 +10,12 @@ COPY . .
1010
ENV CGO_ENABLED=0
1111
RUN go build -v -o /usr/local/bin/light-prover .
1212

13+
RUN mkdir -p /tmp/empty_proving_keys
14+
1315
FROM gcr.io/distroless/base-debian11:nonroot
1416

1517
COPY --from=builder /usr/local/bin/light-prover /usr/local/bin/light-prover
16-
COPY --from=builder /app/proving-keys/ /proving-keys/
18+
COPY --chown=nonroot:nonroot --from=builder /tmp/empty_proving_keys /proving-keys/
1719

1820
ENTRYPOINT [ "light-prover" ]
1921
CMD [ "start", "--inclusion", "--non-inclusion", "--keys-dir", "/proving-keys/" ]

prover/server/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ To run specific tests cd into respective folder (merkle-tree/prover) and `go tes
105105
```shell
106106
docker build -t light-prover .
107107

108-
# /host/path/to/keys should contain the config file
109-
docker run -it \
110-
--mount type=bind,source=host/path/to/config,target=/config \
111-
-p 3001:3001 \
112-
light-prover
108+
docker run -d \
109+
-v /path/to/proving-keys:/proving-keys/:ro \
110+
-p 3001:3001 \
111+
light-prover:latest \
112+
start \
113+
--run-mode forester-test \
114+
--keys-dir /proving-keys/
113115
```
114116

115117
Or in docker compose
@@ -119,7 +121,7 @@ light-prover:
119121
# Path to the repo root directory
120122
build: ./light-prover
121123
volumes:
122-
- /host/path/to/config:/config
124+
- /host/path/to/proving-keys:/proving-keys
123125
ports:
124126
# Server
125127
- "3001:3001"

0 commit comments

Comments
 (0)