From a9bf64fd068d077765cedee575926c0655b0c58d Mon Sep 17 00:00:00 2001 From: Tornado Contrib Date: Fri, 12 Apr 2024 14:18:31 +0000 Subject: [PATCH] Improve docker image by using .dockerignore --- .dockerignore | 15 +++++++++++++++ Dockerfile | 6 +----- package.json | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..90ccfc3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +node_modules + +# Hardhat files +/cache +/artifacts + +# TypeChain files +/typechain +/typechain-types + +# solidity-coverage files +/coverage +/coverage.json + +/flatten \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e803fd2..cadb918 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,8 @@ FROM node:20-alpine WORKDIR /app -COPY ["package.json", "yarn.lock", "./"] - -RUN yarn - COPY . . -RUN yarn build +RUN yarn && yarn build ENTRYPOINT ["yarn", "start"] \ No newline at end of file diff --git a/package.json b/package.json index 313fa8b..0876cdf 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "files": [ "contracts", "src", + ".dockerignore", ".eslintrc.js", ".gitignore", "docker-compose.yml",