When I say a basic Dockerfile. Nestjs is an incredible framework for build backend application for Nodejs developers, using mostly of the common ExpressJS under the hood, and not only that. Docker build for NestJS app. docker build -t makinhs/nestjs-base. Tagged with docker, nestjs, npm, devops.
Another approach to building your own NestJS projects with Docker
NestJS is an incredible framework for building backend applications for NodeJS developers, using mostly of the common ExpressJS under the hood, and not only that. The framework is very consolidate and enterprise friendly. If you are interested in seeing more about NestJS, reach out to my article on how to write a REST API with NestJS
When running your application with containers, specially with NodeJS applications, you usually would like to have faster builds that doesn’t consume much memory. A Basic build with NestJS without much care can go easily up to 1gb, and that will consume time in your CI/CD pipeline as well of a lot of waste of memory. If you want a quick solution for that, you can check out my previous article about docker images for NestJS.
When I say a basic Dockerfile, I mean something like the following:
FROM node:14.15.0-alpine3.10 USER 2000 RUN mkdir -p /home/node/app/node_modules && chown -R 2000:2000 /home/node/app WORKDIR /home/node/app COPY --chown=2000:2000 . /home/node/appRUN yarn installRUN yarn build EXPOSE 3000 ENTRYPOINT ["node"] CMD ["/home/node/app/dist/main.js"]
This would create around ~900mb image.
Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.
Multi-paradigm, Functional, Generic, Imperative, Object-Oriented. In this article, I have shared the essential information about TypeScript programming language. This article contains a basic overview, brief history, features and applications of TypeScript. TypeScript is getting more popular in Full-stack development. In terms of popularity, in the last two years TypeScript pulled ahead of Ruby, Shell, and C.