diff --git a/Dockerfile b/Dockerfile index 8fac7495e1..cd29d762f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,7 @@ WORKDIR /app ADD . /app/ EXPOSE 4000 -# We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com -# See, for example https://github.com/yarnpkg/yarn/issues/5540 -RUN yarn install --network-timeout 300000 +RUN npm install # When running in dev mode, 4GB of memory is required to build & launch the app. # This default setting can be overridden as needed in your shell, via an env file or in docker-compose. @@ -25,4 +23,4 @@ ENV NODE_OPTIONS="--max_old_space_size=4096" # NOTE: At this time it is only possible to run Docker container in Production mode # if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485 ENV NODE_ENV development -CMD yarn serve --host 0.0.0.0 +CMD npm run serve -- --host 0.0.0.0 diff --git a/Dockerfile.dist b/Dockerfile.dist index 4c47b0cb40..cb6e1bbd30 100644 --- a/Dockerfile.dist +++ b/Dockerfile.dist @@ -11,11 +11,11 @@ FROM node:18-alpine AS build RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* WORKDIR /app -COPY package.json yarn.lock ./ -RUN yarn install --network-timeout 300000 +COPY package.json package-lock.json ./ +RUN npm install ADD . /app/ -RUN yarn build:prod +RUN npm run build:prod FROM node:18-alpine RUN npm install --global pm2