Improve docker file

This commit is contained in:
Tornado Contrib 2024-04-11 23:49:27 +00:00
parent ea7498bc2a
commit 90acabfdd7
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
4 changed files with 17 additions and 6 deletions

@ -3,9 +3,10 @@ WORKDIR /app
COPY ["package.json", "yarn.lock", "./"] COPY ["package.json", "yarn.lock", "./"]
RUN npm i -g yarn && yarn RUN yarn
COPY . . COPY . .
EXPOSE 7000 RUN yarn build
ENTRYPOINT ["yarn", "start"] ENTRYPOINT ["yarn", "start"]

@ -19,6 +19,12 @@ services:
dockerfile: maticgasstation.Dockerfile dockerfile: maticgasstation.Dockerfile
expose: expose:
- '127.0.0.1:7000:7000' - '127.0.0.1:7000:7000'
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:7000/v2"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
gaspriceoracle: gaspriceoracle:
container_name: gaspriceoracle container_name: gaspriceoracle
@ -29,5 +35,6 @@ services:
- ./docker.env - ./docker.env
build: build:
context: . context: .
expose: depends_on:
- '127.0.0.1:7000:7000' maticgasstation:
condition: service_healthy

@ -14,10 +14,13 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
ENV REPO=https://github.com/maticnetwork/maticgasstation ENV REPO=https://github.com/maticnetwork/maticgasstation
ENV VERSION=ca8c49c24de98dedac7196b1b07068feeebe856a ENV VERSION=ca8c49c24de98dedac7196b1b07068feeebe856a
RUN git clone $REPO --branch $VERSION && \ RUN git clone $REPO && \
cd maticgasstation && \ cd maticgasstation && \
git checkout $VERSION && \
npm i npm i
WORKDIR /root/maticgasstation
EXPOSE 7000 EXPOSE 7000
ENTRYPOINT ["node", "src/index.js"] ENTRYPOINT ["node", "src/index.js"]

@ -7,7 +7,7 @@
"types": "tsc --declaration --emitDeclarationOnly", "types": "tsc --declaration --emitDeclarationOnly",
"compile": "hardhat compile && hardhat flatten:all", "compile": "hardhat compile && hardhat flatten:all",
"build": "yarn compile && yarn types", "build": "yarn compile && yarn types",
"start": "yarn build && ts-node ./src/index.ts", "start": "ts-node ./src/index.ts",
"lint": "eslint . --ext .ts --ignore-pattern typechain-types" "lint": "eslint . --ext .ts --ignore-pattern typechain-types"
}, },
"files": [ "files": [