Skip to content

Commit

Permalink
fix(Docker): Avoid reinstalling npm modules on code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
orangejulius committed Jan 24, 2019
1 parent e6cced6 commit 8345b25
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
ENV WORKDIR /code/pelias/openaddresses
WORKDIR ${WORKDIR}

# copy package.json first to prevent npm install being rerun when only code changes
COPY ./package.json ${WORK}
RUN npm install

# copy code into image
ADD . ${WORKDIR}

# install npm dependencies
RUN npm install

USER pelias

# run tests
Expand Down

0 comments on commit 8345b25

Please sign in to comment.