From 0eb3890388eba6fd1f8d35f1a1c43b1108d21042 Mon Sep 17 00:00:00 2001 From: ABaldwinHunter Date: Fri, 13 Nov 2015 13:07:22 -0500 Subject: [PATCH] Update dockerfile to copy package.json before running npm install We recently packaged codeclimate-fixme as a node module and so updated the Dockerfile to run simply `npm install`, grabbing the requisite dependencies from the package.json. However, we need to make sure that the package.json gets copied over first. This change fixes the Dockerfile and makes it look more like the flow in some of our other engines. E.g.: codeclimate-rubocop https://github.com/codeclimate/codeclimate-rubocop/blob/master/Dockerfile --- Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 281bff9..c7ff924 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,17 +2,18 @@ FROM node MAINTAINER Michael R. Bernstein -RUN useradd -u 9000 -r -s /bin/false app +WORKDIR /usr/src/app/ + +COPY engine.json / +COPY package.json /usr/src/app/ ENV NODE_ENV production RUN npm install -WORKDIR /code -COPY . /usr/src/app -COPY engine.json / - +RUN useradd -u 9000 -r -s /bin/false app USER app -VOLUME /code + +COPY . /usr/src/app CMD ["/usr/src/app/bin/fixme"]