forked from scroll-tech/scroll-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.deploy
47 lines (33 loc) · 1.25 KB
/
Dockerfile.deploy
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
46
47
# Use the latest node Debian slim base image
# This makes installing yarn dep much easier
FROM node:20-bookworm-slim
# Switch to bash shell
SHELL ["/bin/bash", "-c"]
WORKDIR /root
# Install dependencies
RUN apt update
RUN apt install --yes curl bash coreutils git jq ca-certificates
# Download and run the Foundry installation script
RUN curl -L https://foundry.paradigm.xyz | bash
# Set the environment variables to ensure Foundry tools are in the PATH
ENV PATH="/root/.foundry/bin:${PATH}"
# Run foundryup to update Foundry
RUN foundryup -v nightly-56dbd20c7179570c53b6c17ff34daa7273a4ddae
# copy dependencies
COPY ./lib /contracts/lib
COPY ./node_modules/@openzeppelin /contracts/node_modules/@openzeppelin
# copy configurations
COPY foundry.toml /contracts/foundry.toml
COPY remappings.txt /contracts/remappings.txt
# copy source code
COPY ./src /contracts/src
COPY ./scripts /contracts/scripts
# compile contracts
ENV FOUNDRY_EVM_VERSION="cancun"
ENV FOUNDRY_BYTECODE_HASH="none"
WORKDIR /contracts
RUN forge build
# copy script configs
COPY ./docker/templates/config-contracts.toml /contracts/docker/templates/config-contracts.toml
COPY ./docker/scripts/deploy.sh /contracts/docker/scripts/deploy.sh
ENTRYPOINT ["/bin/bash", "/contracts/docker/scripts/deploy.sh"]