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

Write down the method of building Docker production environment

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Server configuration:

The server uses Aliyun ECS standard, ordinary centos7 and docker environment images.

Set up docker image acceleration:

The speed of docker mirror source is very slow abroad in docker.io, so acceleration in configuration, daocloud acceleration address

Select linux acceleration configuration command, copy and paste execution, direct execution may have a comma error, I have encountered. The workaround is to modify the daemon.json file:

Cd / etc/dockerlscat daemon.jsonvi daemon.json

Just remove the comma at the end of the vi editor I go into edit mode remove and then esc type: wq exit

Image pull:

What is needed is wordpress+mysql+phpmyadmin.

Docker pull mysqldocker pull wordpress

The phpmyadmin image didn't work several times, but at last it worked well with this one.

Docker pull phpmyadmin/phpmyadmin

Container configuration:

Common matching

Docker run-I-t / bin/bash:

-I: standard input to the container

-t: assign a virtual terminal

/ bin/bash: execute the bash script

-d: run as a daemon (background)

-P: by default matches the 5000 port number of the docker container to the 49153 to 65535 port of the host

-p:: specify port number ql container generation

-- name name

-- link links to other containers

Docker run-it-- name myblogsql-e MYSQL_ROOT_PASSWORD=mysqlpwd-d mysql

Wordpress Container configuration Associated mysql Container Mapping Port 80 external Service

Docker run-it-- name mywordpress-- link myblogsql:mysql-p 80:80-d wordpress

Here you can visit the http:// public network ip/ to install wordpress. If it is not accessible, the server can configure security group port 80.

Configure phpmyadmin

1. Map port 8080 of host to port 80 of container

two。 Associate mysql

3. Set the environment variable mysql user name to root and enter the password as the password of root

The copy code is as follows: docker run-it-- name myphpmyadmin-e MYSQL_USERNAME=root-- link myblogsql:db-p 8080 name myphpmyadmin 80-d phpmyadmin/phpmyadmin

Summary:

In practice, wordpress and mysql configuration is easy to configure. When configuring phpmyadmin, you need to specify the alias db. If you do not specify it, you will make an error. The configuration phpmyadmin configuration file and hosts are useless.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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