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
Anyone who has read my articles recently knows th...
Table of contents 1. Install Docker on CentOS 7.9...
This article example shares the specific code of ...
Two problems that are easy to encounter when inst...
MySQL allows you to create multiple indexes on th...
Detailed explanation of the usage of DECIMAL in M...
Table of contents 1. Introduction 2. Installation...
Due to the needs of the work project, song playba...
Let’s not start with the introduction and get str...
There is a table user, and the fields are id, nic...
If you have developed DApps on Ethereum, you may ...
Form validation is one of the most commonly used ...
MySQL Installer provides an easy-to-use, wizard-b...
Harbor Harbor is an open source solution for buil...
After reading some articles, I finally figured ou...