Server placementIt is recommended to use cloud servers (Alibaba Cloud, Huawei Cloud, Tencent Cloud) which can be used for free for a few days. After we buy a server, we will encounter the following problems: The local computer pings the server host and finds that the ping fails and the request times out. We need to find the security group column in the management server interface, and then add icmp when entering and exiting the security group. It is recommended to add all with one click. Then we can ping the server from the local computer. Docker installation After setting up the cloud server, we use Then, we enter Next, we follow the usual software method Package 'docker-ce' has no installation candidate The solution is as follows: #Add docker source sudo echo "deb https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list.d/docker.list #Support parsing https apt-get install -y apt-transport-https ca-certificates curl software-properties-common #Add GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - #Set the repository location add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" Then we execute it again and get the following result Next, verify the installation result by typing nginx installation The next step is The next step is to check the installation effect. Enter the command 1.
Solution: Then enter
Solution vim /etc/nginx/nginx.conf Add the server { .... } Put it in http ... } It can be solved First: Then restart nginx, Browser Testing Finally, we can start the image of the docker container as follows Finally, just check the effect. Just enter the address and port number in the browser. This is the end of this article about the implementation of deploying static websites in docker containers. For more relevant content about deploying static websites in docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: jQuery implements form validation function
>>: Steps to install MySQL 8.0.23 under Centos7 (beginner level)
1. First go to the official website to download t...
The front-end and back-end projects are separated...
Detailed example of getting the maximum value of ...
Table of contents 2. Tried methods 2.1 keep-alive...
This article introduces the sample code of CSS3 c...
Table of contents MySQL Common Functions 1. Numer...
I searched for many ways to change it online but ...
Achieve resultsImplementation Code html <base ...
Table of contents Functional Components How to wr...
The format of textarea can be saved to the databas...
MySQL Bin log data recovery: accidentally delete ...
This article shares simple HTML and music player ...
1. Background A sql-killer process is set up on e...
When we display long text, we often need to interc...
Enable the service when you need it, and disable ...