![]() One of the simplest things you can do to improve performance is to set NODE_ENV to production. The NODE_ENV environment variable specifies the environment in which an application is running (usually, development or production). If you want to learn more about creating your own base images, see Creating base images. ![]() In the same way, when we use the FROM command, we tell Docker to include in our image all the functionality from the node:18-alpine image. This would create a class called MyImage that inherited functionality from the base class NodeBaseImage. For example, if we were able to create Docker images in JavaScript, we might write something like the following. You can think of this in the same way you would think about class inheritance in object oriented programming. ![]() Therefore, instead of creating our own base image, we’ll use the official Node.js image that already has all the tools and packages that we need to run a Node.js application. # syntax=docker/dockerfile:1 FROM node:18-alpineĭocker images can be inherited from other images. Create a directory in your local machine named node-docker and follow the steps below to create a simple REST API. Let’s create a simple Node.js application that we can use as our example.
0 Comments
Leave a Reply. |