Wordpress: stateful or stateless, whats the best approach?

Created on 31 Jan 2015  路  7Comments  路  Source: docker-library/wordpress

I am evaluating the deployment of wordpress with docker for high availability and the biggest issue I found so far is wordpress need for a persisted file system (for uploads/themes etc). This is not particularly docker related, but as docker containers are ephemeral, there should be some tips and tricks to work around this.

So far, I have seen two approaches, a stateful and stateless one. As the stateless version fits better to the docker principles, you have to tweak wordpress very much and the configuration is not very comfortable. The stateful version doesn't need modifications to wordpress but have deal with a distributed filesystem.

At the moment, I would start with the stateless approach, because running distributed filesystems in a docker cluster doesn't seem to be an easy task.

I appreciate any ideas, experiences to this topic. Thanks.

Most helpful comment

I've done a little write up about said stateless wordpress environment. Check it out here

All 7 comments

I have yet to try this plan out in production.. but I want the next WP site I create to consist of three parts:

  • A stateless Docker container based on the wordpress image but with my custom theme added
  • Use of the Amazon S3 plugin, to persist uploaded files away from the container
  • Dedicated MySQL host running outside docker. ie. Amazon RDS

I have just successfully created a stateless dockerised, production wordpress environment.

The process @chazmuzz outlined is exactly the one I have used. With the recent additions for non-linked databases made this possible.

The stateless approach has been the best as my site automatically scales based on the amount of traffic. I can therefore use the smallest possible servers to save myself money in low periods.

If you have any questions, I'd be happy to help.

I've done a little write up about said stateless wordpress environment. Check it out here

Hi! Thanks for the conversation, really interesting insight :)

@mrjackdavis do you think the S3 plugin part is automatisable in some way? Then it would be really 12factor app :)

Can we close the issue now for the sake of keeping the number of issue as low as possible? Thanks :)

@mrjackdavis The write up link is dead. Is it still available?

@avidsapp I've moved the article to medium. Here's the new link

Closing since this is more of a question / discussion than an issue with the image.

In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. Thanks!

Was this page helpful?
0 / 5 - 0 ratings