Skip to content

Instantly share code, notes, and snippets.

@mbenedettini
Last active October 23, 2018 15:28
Show Gist options
  • Save mbenedettini/8b92c5fb8498e35e79ff475a51fc38bc to your computer and use it in GitHub Desktop.
Save mbenedettini/8b92c5fb8498e35e79ff475a51fc38bc to your computer and use it in GitHub Desktop.
Cache node_modules across builds
FROM marianobe/node-base:latest
EXPOSE 3000 3001 3002
RUN npm install -g --unsafe-perm @angular/cli pushstate-server
RUN mkdir -p /usr/src/app/client
WORKDIR /usr/src/app
# Loopback app
COPY package.json /usr/src/app
COPY package-lock.json /usr/src/app
RUN cd /usr/src/app && npm ci
# Angular app
COPY ./client/package.json /usr/src/app/client
COPY ./client/package-lock.json /usr/src/app/client
RUN cd /usr/src/app/client && npm ci
COPY . /usr/src/app
WORKDIR /usr/src/app/client
RUN npm run build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment