Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Sep 15, 2023
1 parent 80ac3e8 commit 5d91076
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM node:16 as build
FROM node:18.17 as build

# Grab needed environment variables from .env.example
ENV REACT_APP_ENV=production
ENV NODE_OPTIONS=--openssl-legacy-provider

WORKDIR /app

COPY package.json yarn.lock ./
COPY ./src/logic/contracts/artifacts/*.json ./src/logic/contracts/artifacts/
RUN yarn install --frozen-lockfile --network-concurrency 1
# Due to some dependencies yarn may randomly throw an error about invalid cache
# This approach is taken from https://github.com/yarnpkg/yarn/issues/7212#issuecomment-506155894 to fix the issue
# Another approach is to install with flag --network-concurrency 1, but this will make the installation pretty slow (default value is 8)
RUN mkdir .yarncache
RUN yarn install --cache-folder ./.yarncache --frozen-lockfile
RUN rm -rf .yarncache
RUN yarn cache clean

COPY . .
RUN yarn build
Expand Down

0 comments on commit 5d91076

Please sign in to comment.