Adding Docker with multi-stage buildĬontainerizing our applications with Docker has many advantages. Now that our application is set up, let’s move on to adding Docker. The CLI wizard is going to ask us to choose between npm and yarn in this guide, we will be using npm. Keep in mind that the application will be generated in the app-name folder in the current directory. Naturally, app-name is replaced by the actual name of the application. To install the CLI globally, run: npm install -g in order to create an application, we can execute: nest new app-name We can easily create a new NestJS application with its dedicated CLI. Note: This article assumes basic knowledge of Docker. Here’s where Docker containerization becomes indispensable. The application should also ensure everything it depends on, like the aforementioned external services, is created during the start process. Ideally, our application should be started with a single command that guarantees it will work as expected regardless of the developer’s choice of machine/environment. The generated setup is fine for a simple application, but as it gets more complex and starts to rely on external services like Postgres or Redis, it could take quite a while for developers to set everything up themselves due to differences in the machines they’re using or whether they have all the necessary services already installed. With a single command, nest new app-name, we have a fully functional, ready-to-go application. Containerized development with NestJS and DockerĬreating a brand-new NestJS application is a breeze thanks to its awesome CLI. Maciej Cieślar Follow A JavaScript developer and a blogger at.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |