Skip to content

Commit

Permalink
Replaced npm with yarn in api-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzziah Eyee committed May 8, 2019
1 parent 66dac89 commit f7aba0c
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 557 deletions.
4 changes: 2 additions & 2 deletions api-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.env
/node_modules
npm-debug.log
node_modules
yarn-error.log
.DS_Store
17 changes: 10 additions & 7 deletions api-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ FROM node:10.10.0-alpine

WORKDIR /usr/src/app

# optimization to only rebuild npm modules iff package[-lock].json changes
COPY src/package*.json ./
RUN apk add --no-cache bash curl \
&& yarn global add nodemon

# TODO: only install nodemon if some arg is set to 'dev'
RUN npm install -g nodemon
# For production `RUN npm install --only=production`
RUN npm install

COPY src/package.json src/yarn.lock ./
RUN yarn install

COPY src .

CMD ["node", "."]
CMD ["node", "."]

# ref: https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md
# https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
# https://runnable.com/blog/9-common-dockerfile-mistakes
Loading

0 comments on commit f7aba0c

Please sign in to comment.