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

Deploy wordpress blog system with docker-compose

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

Share

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

Fix docker-compose first so that it can use:

[root@localhost] # curl-L https://github.com/docker/compose/releases/download/1.25.1-rc1/docker-compose-`uname-s-uname-m`-o / usr/local/bin/docker-compose

[root@localhost ~] # chmod + x / usr/local/bin/docker-compose

[root@localhost] # docker-compose-v

Docker-compose version 1.25.1-rc1, build d92e9bee

Need two packages, mine is the following local package, you can also download it online, but pay attention to the version number:

Mirror them:

[root@localhost ~] # docker load

< mysql-5.7.tar [root@localhost ~]# docker load < wordpress.tar 得出以下两个镜像: 创建一个目录,再目录里面写入docker-compose.yml文件: [root@localhost ~]# mkdir wordpress [root@localhost ~]# cd wordpress/ [root@localhost wordpress]# vim docker-compose.yml version: "3.1" services: wordpress: image: wordpress restart: always ports: 8080:80 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: 123.com WORDPRESS_DB_NAME: wordpress db: image: mysql:5.7 restart: always environment: MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: 123.com MYSQL_ROOT_PASSWORD: 123.com 启动容器: [root@localhost wordpress]# docker-compose up -d 最后浏览器访问:ip地址加端口8080:

The browser cannot access it because routing forwarding is not enabled. Just turn it on, the following command:

[root@localhost wordpress] # echo net.ipv4.ip_forward = 1 > > / etc/sysctl.conf

[root@localhost wordpress] # systemctl restart network

You can access 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