Writing a Dockerfile Taking the directory automatically created by ├── /bin │ └── www ├── /node_modules ├── /public ├── /routes ├── /views ├── package-lock.json ├── package.json ├── ecosystem.config.js ├── app.js └── Dockerfile Create a new FROM node:10.15 MAINTAINER [email protected] COPY ./app/ WORKDIR /app RUN npm install pm2 -g EXPOSE 8003 CMD ["pm2-runtime", "ecosystem.config.js"]
Build the image Execute in the project directory docker build -t express-app:v1 . If the build is successful, check the mirror list docker images The image Running the container docker run -d -p 8003:3000 --name="express-app" express-app:v1
implement docker ps The normal display is as follows Add the Entering the container If you want to enter the container to operate, execute the following command docker exec -it express-app bash Similar to Close Operation Stop the container docker stop express-app Deleting a container docker rm express-app If the container is still running when you delete it, you need to add the Deleting an image docker rmi express-app:v1 The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed tutorial on MySql installation and uninstallation
>>: Tips for writing concise React components
Table of contents Solution: 1. IGNORE 2. REPLACE ...
Because the project needs to use https service, I...
The test is passed in the nodejs environment. The...
In Nginx, there are some advanced scenarios where...
1. Function : Allows the parent component to inse...
Table of contents Separation effect Command line ...
This article mainly introduces how to specify par...
Table of contents Method 1: set: It is not a data...
First, let’s look at the GIF operation: Case 1: S...
What are :is and :where? :is() and :where() are p...
/********************** * Linux memory management...
1. concat() function Function: Concatenate multip...
Table of contents 1. Connect to Tencent Cloud Ser...
Table of contents 1. Structural instructions Modu...
1. Download the virtual machine Official download...