mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 16:37:56 -05:00
48 lines
1.2 KiB
Docker
48 lines
1.2 KiB
Docker
# 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
|
|
|
|
# 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"]
|