Skip to content

Commit 7bf8b59

Browse files
committed
feat: add dockerfile
1 parent 7e53b15 commit 7bf8b59

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git
2+
out
3+
cache
4+
broadcast
5+
**/node_modules
6+
.vscode
7+
.env

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ out/
66
broadcast/
77
.tool-versions
88
.env
9+
.vscode

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM ghcr.io/foundry-rs/foundry:v1.5.0 AS builder
2+
WORKDIR /app
3+
4+
COPY . .
5+
6+
RUN forge build
7+
8+
FROM ghcr.io/foundry-rs/foundry:v1.5.0 AS runtime
9+
WORKDIR /app
10+
11+
COPY --from=builder /app .
12+
13+
ENTRYPOINT ["forge"]

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ There are some helper scripts (deployment, executing special contract methods, .
1616

1717
**TODO: Add information for the involved scripts.**
1818

19+
## Docker
20+
21+
A Foundry-based (forge/cast/anvil) image is available via the included `Dockerfile` (pinned to `ghcr.io/foundry-rs/foundry:v1.5.0`).
22+
23+
Build the image:
24+
25+
docker build -t shutter-contracts .
26+
27+
Execute scripts by supplying your RPC URL and key:
28+
29+
docker run --rm -it -v "$(pwd)":/app --env RPC_URL=https://... --env PRIVATE_KEY=0x... \
30+
shutter-contracts script script/Deploy.s.sol --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY"
31+
32+
Override the entrypoint if you need `cast`, `anvil`, or other tooling, for example `docker run --entrypoint cast ...`.
33+
1934
## Tests
2035

2136
To manually run the tests, execute

0 commit comments

Comments
 (0)