Skip to content

Commit

Permalink
Fix Dockerfile && update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuphi committed Oct 7, 2020
1 parent b4c99b7 commit 0923d35
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
26 changes: 18 additions & 8 deletions .docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
FROM node:12-alpine

RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
FROM node:12-alpine as builder

RUN apk add --no-cache python make g++

RUN mkdir -p /home/node/app

WORKDIR /home/node/app

COPY package*.json ./
COPY . .

RUN npm install --production

USER node

RUN npm install
FROM node:12-alpine

RUN mkdir -p /home/node/app

WORKDIR /home/node/app

USER node

COPY --chown=node:node . .
COPY --chown=node:node --from=builder /home/node/app .

EXPOSE 8080
EXPOSE 3000

CMD [ "node", "index.js" ]
CMD [ "node", "index" ]
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
.dockerignore
.git
.idea
.node
.github
.editorconfig
.eslintrc.js
.gitignore
.travis.yml

0 comments on commit 0923d35

Please sign in to comment.