wordpress可以用来做什么?
wordpress可以快速构建一个自己的网站。
第1步:新建一个目录。
[root@docker Dockerfile]# mkdir wordpress [root@docker Dockerfile]# cd wordpress/ [root@docker wordpress]#
第2步:vim docker-compose.yml。
[root@docker wordpress]# vim docker-compose.yml [root@docker wordpress]# cat docker-compose.yml services: db: # We use a mariadb image which supports both amd64 & arm64 architecture image: mariadb:10.6.4-focal # If you really want to use MySQL, uncomment the following line #image: mysql:8.0.27 command: '--default-authentication-plugin=mysql_native_password' volumes: - db_data:/var/lib/mysql restart: always environment: - MYSQL_ROOT_PASSWORD=somewordpress - MYSQL_DATABASE=wordpress - MYSQL_USER=wordpress - MYSQL_PASSWORD=wordpress expose: - 3306 - 33060 wordpress: image: wordpress:latest volumes: - wp_data:/var/www/html ports: - 80:80 restart: always environment: - WORDPRESS_DB_HOST=db - WORDPRESS_DB_USER=wordpress - WORDPRESS_DB_PASSWORD=wordpress - WORDPRESS_DB_NAME=wordpress volumes: db_data: wp_data: [root@docker wordpress]# ls docker-compose.yml
第3步:启动wordpress和数据库容器。
[root@docker wordpress]# docker compose up [+] Running 2/0 ⠿ Container wordpress-db-1 Running 0.0s ⠿ Container wordpress-wordpress-1 Running 0.0s Attaching to wordpress-db-1, wordpress-wordpress-1 [root@docker wordpress]# docker compose ps NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS wordpress-db-1 mariadb:10.6.4-focal "docker-entrypoint.s…" db 7 hours ago Up 6 hours 3306/tcp, 33060/tcp wordpress-wordpress-1 wordpress:latest "docker-entrypoint.s…" wordpress 7 hours ago Up 6 hours 0.0.0.0:80->80/tcp, :::80->80/tcp
第4步:浏览器里直接输入ip。
原文链接:https://blog.csdn.net/qq_60271706/article/details/129630177?ops_request_misc=&request_id=9e2f7293649746b690ddb35a9fb1af7d&biz_id=&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~koosearch~default-27-129630177-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