2020-02-12 12:54:45 +00:00
|
|
|
FROM node:10.19.0 as base
|
2019-02-19 14:51:34 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2020-02-12 12:54:45 +00:00
|
|
|
# install_deps changes app files and installs npm packages
|
|
|
|
# as such it has to run at a later stage
|
|
|
|
|
|
|
|
FROM base as app
|
|
|
|
|
2019-02-19 14:51:34 +00:00
|
|
|
#wildcard as some files may not be in all repos
|
2019-08-02 08:47:45 +00:00
|
|
|
COPY package.json package-lock.json /app/
|
2019-02-19 14:51:34 +00:00
|
|
|
|
|
|
|
RUN npm install --quiet
|
|
|
|
|
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
|
2020-02-12 12:54:45 +00:00
|
|
|
FROM base
|
2019-02-19 14:51:34 +00:00
|
|
|
|
|
|
|
COPY --from=app /app /app
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
|
|
|
USER node
|
|
|
|
|
|
|
|
CMD ["node", "--expose-gc", "app.js"]
|