-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add scratch node image build step
- Loading branch information
1 parent
0fe4510
commit 9acc170
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,19 @@ jobs: | |
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
- name: Build and push fork image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/lidofinance/hardhat-node:${{ github.ref_name }} | ||
|
||
- name: Build and push scratch image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: scratch.Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/lidofinance/hardhat-node:${{ github.ref_name }}-scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import "dotenv/config"; | ||
import { HardhatUserConfig } from "hardhat/config"; | ||
import "@nomicfoundation/hardhat-ethers"; | ||
|
||
const config: HardhatUserConfig = { | ||
solidity: "0.8.23", | ||
networks: { | ||
hardhat: { | ||
initialBaseFeePerGas: 0, | ||
accounts: { | ||
count: 10, | ||
}, | ||
chainId: 1, | ||
}, | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Comments are provided throughout this file to help you get started. | ||
# If you need more help, visit the Dockerfile reference guide at | ||
# https://docs.docker.com/go/dockerfile-reference/ | ||
|
||
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7 | ||
|
||
ARG NODE_VERSION=lts | ||
ARG PNPM_VERSION=9.11.0 | ||
|
||
FROM node:${NODE_VERSION}-alpine | ||
|
||
# Use production node environment by default. | ||
ENV NODE_ENV=production | ||
|
||
# Install pnpm. | ||
RUN --mount=type=cache,target=/root/.npm \ | ||
npm install -g pnpm@${PNPM_VERSION} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Download dependencies as a separate step to take advantage of Docker's caching. | ||
# Leverage a cache mount to /root/.local/share/pnpm/store to speed up subsequent builds. | ||
# Leverage a bind mounts to package.json and pnpm-lock.yaml to avoid having to copy them into | ||
# into this layer. | ||
RUN --mount=type=bind,source=package.json,target=package.json \ | ||
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ | ||
--mount=type=cache,target=/root/.local/share/pnpm/store \ | ||
pnpm install --prod --frozen-lockfile | ||
|
||
# Copy the rest of the source files into the image. | ||
COPY . . | ||
COPY hardhat.config.scratch.ts hardhat.config.ts | ||
|
||
# Expose the port that the application listens on. | ||
EXPOSE 8545 | ||
|
||
# Run the application. | ||
CMD ["pnpm", "start"] |