简体   繁体   English

使用Docker在Wordpress上连续交付

[英]Continuous Delivery on Wordpress using Docker

I have had this problem very often in the past: I have a wordpress site that is in production. 过去,我经常遇到这个问题:我有一个正在生产的wordpress网站。 I deployed the site manually from my local machine. 我从本地计算机手动部署了该站点。 So if there were changes, I exported the database and the files from the local file system again and imported them on the remote production server. 因此,如果有更改,我将再次从本地文件系统中导出数据库和文件,并将它们导入到远程生产服务器上。 That sucks, especially if you have a different enviroment on your remote server (different OS, different PHP version, different MySQL, etc.). 这很糟糕,特别是如果您的远程服务器上有不同的环境(不同的OS,不同的PHP版本,不同的MySQL等)。

So I decided to use Docker and Docker containers to run my Wordpress site. 因此,我决定使用Docker和Docker容器运行我的Wordpress网站。

During my work as developer for Java and Node.js applications I started to love the way you can test and deploy changes from your development to your production environment using a Continuous Delivery pipeline. 在担任Java和Node.js应用程序开发人员的过程中,我开始喜欢使用“持续交付”管道测试和部署从开发到生产环境的更改的方式。

How can I establish this workflow on a Wordpress site + MySQL that are running in Docker containers? 如何在Docker容器中运行的Wordpress网站+ MySQL上建立此工作流程? Especially, how can I apply the changes I have made on the local MySQL to the remote MySQL DB? 特别是,如何将对本地MySQL所做的更改应用于远程MySQL DB?

SOLVED: I have found a good discussion and explanation on how to keep data persistent on StackOverflow: go here 求助:我已经找到了关于如何在StackOverflow上保持数据持久性的很好的讨论和解释: 转到此处

Also this tutorial from DigitalOcean might help you. 另外,DigitalOcean的本教程可能会为您提供帮助。

  1. First, you should put wordpress source code on git or svn server. 首先,您应该将WordPress的源代码放在git或svn服务器上。 Then you can clone it into docker container. 然后您可以将其克隆到docker容器中。
  2. After you built images for wordpress and mysql, you can map port to external ip address, which you can connect to mysql database from your computer with command: 为wordpress和mysql构建映像后,可以将端口映射到外部ip地址,您可以使用以下命令从计算机连接到mysql数据库:

    docker run -d -it -port 3306:3306 ............. docker run -d -it -port 3306:3306 .............

  3. You can follow this to do: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-and-phpmyadmin-with-docker-compose-on-ubuntu-14-04 您可以按照以下步骤进行操作: https : //www.digitalocean.com/community/tutorials/how-to-install-wordpress-and-phpmyadmin-with-docker-compose-on-ubuntu-14-04

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM