2018-07-26 06:30:06 +03:00
|
|
|
FROM node:10-alpine
|
2015-08-27 20:42:05 +03:00
|
|
|
|
2016-01-27 21:54:28 +03:00
|
|
|
# add a non-privileged user for installing and running
|
|
|
|
# the application
|
2018-07-26 06:30:06 +03:00
|
|
|
RUN addgroup -g 10001 app && \
|
|
|
|
adduser -D -G app -h /app -u 10001 app
|
2016-01-27 21:54:28 +03:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2016-10-20 05:31:30 +03:00
|
|
|
# Install node requirements and clean up temporary files
|
2016-01-27 21:54:28 +03:00
|
|
|
COPY package.json package.json
|
2018-07-26 06:30:06 +03:00
|
|
|
RUN apk add --update build-base ca-certificates git python gmp-dev && \
|
|
|
|
npm --loglevel warn install && \
|
|
|
|
npm cache clear --force && \
|
|
|
|
apk del --purge build-base gcc git python && \
|
2016-10-20 05:31:30 +03:00
|
|
|
rm -rf ~app/.node-gyp && \
|
2018-07-26 06:30:06 +03:00
|
|
|
rm -rf ~app/.npm
|
2015-08-27 20:42:05 +03:00
|
|
|
|
2016-01-27 21:54:28 +03:00
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
USER app
|
|
|
|
ENTRYPOINT ["npm"]
|
|
|
|
CMD ["start"]
|