In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to build a blog with Docker and wordpress". In the operation of practical cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Use Docker and wordpress to build a personal blog
1. Let's explain two concepts first.
Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image, publish them to any popular Linux or Windows machine, and virtualize them. Containers completely use sandbox mechanism and will not have any interface with each other.
Docker-Compose, an orchestration service of Docker, is a tool for defining and running complex applications on Docker, which allows users to deploy distributed applications in clusters.
Service (service): a container for an application that can actually include several container instances running the same image.
Project (project): a complete business unit consisting of a set of associated application containers, defined in the docker-compose.yml file.
The default management object of Compose is the project, and the life cycle of a set of containers in the project can be easily managed through subcommands.
2. Install Docker
The specific installation method can be installed according to your own system.
For window system installation, you can refer to the rookie tutorial: https://www.runoob.com/docker/windows-docker-install.html
MacOC installation:
Install using Homebrew
MacOS We can use Homebrew to install Docker.
Homebrew's Cask already supports Docker for Mac, so it's easy to install using Homebrew Cask.
The command is:
$brew cask install docke
The screenshots of the installation are as follows:
After loading Docker app, click Next, you may be asked for your macOS login password, you can enter it. After that, a prompt window for Docker to run will pop up, and there will also be an icon of a little whale on the status bar.
After starting the terminal, you can check the installed version of Docker with the command.
$docker-- versionDocker version 19.03.12, build 48a66213fe3, image acceleration
In view of the domestic network problems, it is very slow to pull the Docker image later. We can configure an accelerator to solve it. I use NetEase's image address: http://hub-mirror.c.163.com.
Click the Docker for mac App icon in the taskbar-> Perferences … -> Docker Engine. Just fill in the accelerator address in the list. After the modification is completed, click the Apply & Restart button, and Docker will restart and apply the configured image address.
Then type in the terminal:
$docker info
4. Install Wordpress
Create a new folder and name it according to yourself.
Then create the docker-compose.yml file and put it in the folder you just had.
The docker-compose.yml is as follows:
Version: '3.3'services: db: image: mysql:5.7 volumes:-db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on:-db image: wordpress:latest ports:-"8000 image 80 "restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_DB_NAME: wordpressvolumes: db_data: {}
Then go to the newly created folder directory on the terminal and use one line of command to build the blog:
$docker-compose up-d
Problems may occur here, as follows:
The reason for this problem is that image acceleration is not properly configured. Because docker uses foreign images by default, downloading resources is relatively slow, so you need to modify it to domestic images for acceleration. For more information, please see the image acceleration point 3 above.
The screenshot of the successful effect is as follows:
5. Front-end management page
Front desk address: IP:8000/: because I am now a newly built blog, so ip is localhost
Go to this page, the specific language can be chosen according to your preference, here I choose Chinese, click continue.
You can fill in the information according to your personal preference.
After logging in to the account password, the blog backend page is as follows:
Modify the language:
Modify the theme:
That's all for "how to build a blog with Docker and wordpress". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.