mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Merge pull request #40 from zkokk/network
Docker image with the deployed contract
This commit is contained in:
commit
6f0879ddfa
4 changed files with 23 additions and 16 deletions
|
|
@ -1,19 +1,18 @@
|
|||
FROM node:lts-alpine
|
||||
FROM node:22-alpine3.19
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
WORKDIR /usr/app
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package*.json ./
|
||||
COPY . /usr/src/app
|
||||
|
||||
RUN npm install
|
||||
RUN npm install wait-on
|
||||
|
||||
COPY . .
|
||||
COPY $PWD/entrypoint.sh /usr/local/bin
|
||||
|
||||
EXPOSE 8545
|
||||
|
||||
COPY entrypoint.sh /usr/app/entrypoint.sh
|
||||
RUN chmod +x $PWD/entrypoint.sh
|
||||
|
||||
RUN chmod +x /usr/app/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/app/entrypoint.sh"]
|
||||
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]
|
||||
|
|
@ -1,7 +1,14 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Deploy the contracts using Hardhat Ignition
|
||||
npx hardhat ignition deploy /usr/app/ignition/modules/Apollo.js
|
||||
# Change to the correct directory
|
||||
cd /usr/src/app;
|
||||
|
||||
# Run the tests
|
||||
npx hardhat test
|
||||
# Start hardhat node as a background process
|
||||
nohup npx hardhat node &
|
||||
|
||||
# Wait for hardhat node to initialize and then deploy contracts
|
||||
npx wait-on http://127.0.0.1:8545 && nohup npm run deploy;
|
||||
|
||||
# The hardhat node process never completes
|
||||
# Waiting prevents the container from pausing
|
||||
wait $!
|
||||
0
hardhat/ignition/modules/Apollo.js
Normal file → Executable file
0
hardhat/ignition/modules/Apollo.js
Normal file → Executable file
|
|
@ -3,7 +3,7 @@
|
|||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"deploy": "npx hardhat ignition deploy ./ignition/modules/Apollo.js --network localhost"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
"devDependencies": {
|
||||
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.4",
|
||||
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
|
||||
"hardhat": "^2.22.5"
|
||||
"hardhat": "^2.22.5",
|
||||
"wait-on": "^7.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue