Skip to content

Commit

Permalink
Create DockerFile
Browse files Browse the repository at this point in the history
  • Loading branch information
cetrix13 committed Sep 4, 2022
1 parent 2f55f7e commit bf5c3b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# node_modules contains dependecies necessary only for build
node_modules

# directory will be autogenerated on a successfull build
dist

# not necessary for a build
test
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:14-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm ci
WORKDIR /app
COPY ./ .
RUN npm run build

FROM node:14-alpine as production-stage
COPY --from=build-stage /app/dist ./dist

USER node
ENV PORT=8081
EXPOSE 8081

CMD [ "node", "dist/main.js" ]

0 comments on commit bf5c3b2

Please sign in to comment.