Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# node_modules will be installed during image build
node_modules

# dist folder will be generated from src folder during image build
dist

# test folder is not used during image build
test
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:14-alpine As base
WORKDIR /app
COPY package*.json ./
RUN npm install
WORKDIR /app
COPY . .
RUN npm run build

FROM node:14-alpine As application
COPY --from=base /app/package*.json ./
RUN npm install --only=production
COPY --from=base /app/dist ./dist

USER node
ENV PORT=8081
EXPOSE 8081

CMD [ "node", "dist/main.js" ]
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ async function bootstrap() {
}
bootstrap().then(() => {
console.log('App is running on %s port', port);
});
});
Loading