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)
Color contrast and harmony In contrasting conditi...
Table of contents 1. DOM Diff 2. Add key attribut...
The generation and verification of random codes i...
Find the installation directory of VirtualBox. Th...
Table of contents Environment Setup Overview 1.Wh...
Last week, the teacher gave me a small homework, ...
Introduction to void keyword First of all, the vo...
Preface Recently our server was attacked by hacke...
Copy code The code is as follows: <!DOCTYPE ht...
Table of contents 1. Overview 1. Explain statemen...
Table of contents background Main content 1. Comp...
<!DOCTYPE html> <html lang="en"...
First go to the official website to download and ...
The results are different in Windows and Linux en...
The following error occurred while installing the...