作者:吴业亮
博客:wuyeliang.blog.csdn.net
一、安装docker
1、配置源
cat <<END >/etc/yum.repos.d/repo.repo [repo] name=repo baseurl = https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/7/x86_64/stable/ enabled=1 gpgcheck=0 END
2、安装docker-ce
yum install docker-ce
3、启动服务和设置开机启动
# service docker start # chkconfig docker on
4、配置国内源
# mkdir -p /etc/docker # tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://***.mirror.aliyuncs.com"] } EOF # service docker restart
二、安装docker-compose
# yum install epel* -y # yum install docker-compose -y
三、安装wordpress
1、创建 stack.yml
version: '3.1' services: wordpress: image: wordpress restart: always ports: - 8080:80 environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: exampleuser WORDPRESS_DB_PASSWORD: examplepass WORDPRESS_DB_NAME: exampledb volumes: - wordpress:/var/www/html db: image: mysql:5.7 restart: always environment: MYSQL_DATABASE: exampledb MYSQL_USER: exampleuser MYSQL_PASSWORD: examplepass MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - db:/var/lib/mysql volumes: wordpress: db:
2、启动
docker-compose -f stack.yml up
3、登录web
http://ip:8080
原文链接:https://blog.csdn.net/wylfengyujiancheng/article/details/105292979?ops_request_misc=&request_id=87ba146a8195450c82f4155ce0d0ac05&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~koosearch~default-30-105292979-null-null.268%5Ev1%5Econtrol&utm_term=docker%E3%80%81wordpress%E3%80%81wordpress%E5%BB%BA%E7%AB%99%E3%80%81wordpress%E4%B8%BB%E9%A2%98%E3%80%81%E5%AE%B9%E5%99%A8%E9%95%9C%E5%83%8F%E3%80%81
© 版权声明
声明📢本站内容均来自互联网,归原创作者所有,如有侵权必删除。
本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。
THE END