Skip to content

Commit

Permalink
Add Dockerfile (#42)
Browse files Browse the repository at this point in the history
* Add Dockerfile

* Change image app workdir
  • Loading branch information
hectorgomezv authored Aug 22, 2022
1 parent f1d434a commit b49f251
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dockerfile
.dockerignore
node_modules
dist
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# BUILD CONTAINER
#
FROM node:16 as base
USER node
ENV NODE_ENV production
WORKDIR /app
COPY --chown=node:node package.json yarn.lock .yarnrc.yml tsconfig*.json ./
COPY --chown=node:node .yarn/releases ./.yarn/releases
RUN yarn install --immutable
COPY --chown=node:node . .
RUN yarn run build

#
# PRODUCTION CONTAINER
#
FROM node:16-alpine as production
USER node
COPY --chown=node:node --from=base /app/node_modules ./node_modules
COPY --chown=node:node --from=base /app/dist ./dist
CMD [ "node", "dist/main.js" ]

0 comments on commit b49f251

Please sign in to comment.