Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of using docker to build wordpress

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use docker to build wordpress. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Introduction

This is not a formal wordpress building article, but based on the previous article, the implementation. The final implementation is to use nginx as a proxy, an independent wordpress container, and connect the MySQL of laradock to do storage.

Modify nginx Agent

Compared with the configuration of laradock, it only modifies the domain name for listening and the port for forwarding. Create a new wordpress.conf file in the / etc/nginx/conf.d/ directory as follows

Server {listen 80; server_name blog.you_site.com; location / {proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://[ host IP]: 8001;}}

Remember to restart after modification

Set up a wordpress container

1. Pull image docker pull wordpress

two。 Because wordpress needs to connect to the MySQL container, which happens to be available in laradock, just use this. The way to connect does not need-- link, use-- network, you can refer to here

The network of MySQL in 3.laradock is written in the docker-compose.yml file, as follows

At the same time, using docker network ls to view, you can see the laradock_backend network. It is obvious that you can use laradock_backend.

1. Build the container docker run-d-- name wordpress-p 8001 network laradock_backend wordpress 80-- network laradock_backend wordpress

two。 The last step is to open the server (host) port 8001

Conclusion

Open the URL and the configuration interface appears. Just set Database Host to mysql. Other data sheets, users, etc., are not within the scope of discussion.

On the use of docker to build wordpress method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report