Dockerfile 814 Bytes
Newer Older
1
FROM node:10.15.0
2

3 4
RUN mkdir -p /app
RUN mkdir -p /npm_cache
5 6 7

WORKDIR /app

8
RUN npm install npm@latest-5 -g
9

Andrew Newdigate's avatar
Andrew Newdigate committed
10 11 12
RUN npm config set cache /npm_cache
RUN npm config set prefer-offline true

13 14 15 16
COPY package.json package-lock.json scripts/filter-package-json-cli.js scripts/filter-package-lock-json-cli.js /app/
# Remove the local dependencies(`file:` entries) from package.json and package-lock.json
RUN cat package.json | node filter-package-json-cli.js > temp-package.json && cat temp-package.json > package.json && rm temp-package.json
RUN cat package-lock.json | node filter-package-lock-json-cli.js > temp-package-lock.json && cat temp-package-lock.json > package-lock.json && rm temp-package-lock.json
Andrew Newdigate's avatar
Andrew Newdigate committed
17
RUN npm install
18 19

RUN rm -rf /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg /root/.ssh 2>/dev/null