[{"data":1,"prerenderedAt":362},["Reactive",2],{"content-query-MAb5LDDEuB":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"head":10,"layout":12,"body":13,"_type":357,"_id":358,"_source":359,"_file":360,"_extension":361},"/docs/guide/using-wordpress-with-docker","guide",false,"","Using WordPress with Docker","Learn how serversideup/php is optimized for running WordPress in production.",{"title":11},"WordPress Optimizations - Docker PHP - Server Side Up","docs",{"type":14,"children":15,"toc":345},"root",[16,24,30,35,42,67,83,89,103,115,120,127,132,137,169,174,180,185,216,222,227,266,272,284,289,319,324,330,335],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"using-wordpress-with-docker",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":23,"value":29},"Ready to take the dive and modernize WordPress with Docker?",{"type":17,"tag":25,"props":31,"children":32},{},[33],{"type":23,"value":34},"Long story short, it can be definitely be worth it depending on your use case. From our experience, you can save yourself hours, or really over-engineer and dig yourself a hole.",{"type":17,"tag":36,"props":37,"children":39},"h2",{"id":38},"wordpress-security-optimizations",[40],{"type":23,"value":41},"WordPress & Security Optimizations",{"type":17,"tag":43,"props":44,"children":45},"ul",{},[46,52,57,62],{"type":17,"tag":47,"props":48,"children":49},"li",{},[50],{"type":23,"value":51},"Hardening of Apache & NGINX included",{"type":17,"tag":47,"props":53,"children":54},{},[55],{"type":23,"value":56},"Disabling of XML-RPC",{"type":17,"tag":47,"props":58,"children":59},{},[60],{"type":23,"value":61},"Preventative access to sensitive version control or CI files",{"type":17,"tag":47,"props":63,"children":64},{},[65],{"type":23,"value":66},"Protection against other common attacks",{"type":17,"tag":25,"props":68,"children":69},{},[70,72,81],{"type":23,"value":71},"See our ",{"type":17,"tag":73,"props":74,"children":78},"a",{"href":75,"rel":76},"https://github.com/serversideup/docker-php/blob/main/src/variations/fpm-apache/etc/apache2/conf-available/security.conf",[77],"nofollow",[79],{"type":23,"value":80},"Apache security.conf",{"type":23,"value":82}," for more detail.",{"type":17,"tag":36,"props":84,"children":86},{"id":85},"the-wordpress-way",[87],{"type":23,"value":88},"\"The WordPress Way\"",{"type":17,"tag":25,"props":90,"children":91},{},[92,94,101],{"type":23,"value":93},"We're very grateful for WordPress, and it even runs our blog for ",{"type":17,"tag":73,"props":95,"children":98},{"href":96,"rel":97},"https://serversideup.net/",[77],[99],{"type":23,"value":100},"Server Side Up",{"type":23,"value":102},". The only downside with WordPress is it has a lot of history with it. That means the core was written with in a mindset before all of the fancy and flashy methods that we have today.",{"type":17,"tag":25,"props":104,"children":105},{},[106,108,113],{"type":23,"value":107},"The most important thing you need to remember is always try to do things ",{"type":17,"tag":109,"props":110,"children":111},"em",{},[112],{"type":23,"value":88},{"type":23,"value":114},".",{"type":17,"tag":25,"props":116,"children":117},{},[118],{"type":23,"value":119},"The more you work with it, the less you are fighting the platform.",{"type":17,"tag":121,"props":122,"children":124},"h3",{"id":123},"what-do-you-mean-by-fighting-the-platform",[125],{"type":23,"value":126},"What do you mean by \"fighting the platform\"?",{"type":17,"tag":25,"props":128,"children":129},{},[130],{"type":23,"value":131},"Introducing modern toolsets to WordPress may allow you to get WordPress up and running, but severely limit you to the rest of the community tools.",{"type":17,"tag":25,"props":133,"children":134},{},[135],{"type":23,"value":136},"This could be things like (but not limited to):",{"type":17,"tag":43,"props":138,"children":139},{},[140,145,150,155],{"type":17,"tag":47,"props":141,"children":142},{},[143],{"type":23,"value":144},"Using NGINX as the web server",{"type":17,"tag":47,"props":146,"children":147},{},[148],{"type":23,"value":149},"Deploying updates by packaging WordPress into a Docker Image",{"type":17,"tag":47,"props":151,"children":152},{},[153],{"type":23,"value":154},"Using too new of a PHP version",{"type":17,"tag":47,"props":156,"children":157},{},[158,160,167],{"type":23,"value":159},"Using ",{"type":17,"tag":73,"props":161,"children":164},{"href":162,"rel":163},"https://roots.io/",[77],[165],{"type":23,"value":166},"Roots Bedrock",{"type":23,"value":168}," to modernize your development flow",{"type":17,"tag":25,"props":170,"children":171},{},[172],{"type":23,"value":173},"We've tried all of these above and we learned that most of the plugins that we relied on had issues with this.",{"type":17,"tag":36,"props":175,"children":177},{"id":176},"how-does-server-side-up-run-wordpress",[178],{"type":23,"value":179},"How does Server Side Up run WordPress?",{"type":17,"tag":25,"props":181,"children":182},{},[183],{"type":23,"value":184},"We embrace these principals:",{"type":17,"tag":186,"props":187,"children":188},"ol",{},[189,194,199,204],{"type":17,"tag":47,"props":190,"children":191},{},[192],{"type":23,"value":193},"Always do things \"The WordPress Way\"",{"type":17,"tag":47,"props":195,"children":196},{},[197],{"type":23,"value":198},"Keep plugin installation to a minimum",{"type":17,"tag":47,"props":200,"children":201},{},[202],{"type":23,"value":203},"Always use Apache as the webserver",{"type":17,"tag":47,"props":205,"children":206},{},[207,209,214],{"type":23,"value":208},"Only commit ",{"type":17,"tag":109,"props":210,"children":211},{},[212],{"type":23,"value":213},"your own",{"type":23,"value":215}," source code (not WordPress core or another plugin)",{"type":17,"tag":36,"props":217,"children":219},{"id":218},"the-structure",[220],{"type":23,"value":221},"The structure",{"type":17,"tag":25,"props":223,"children":224},{},[225],{"type":23,"value":226},"We run WordPress in production on Docker Swarm using:",{"type":17,"tag":186,"props":228,"children":229},{},[230,242,254],{"type":17,"tag":47,"props":231,"children":232},{},[233,240],{"type":17,"tag":73,"props":234,"children":237},{"href":235,"rel":236},"https://traefik.io/traefik/",[77],[238],{"type":23,"value":239},"Traefik",{"type":23,"value":241}," (handles SSL automatically with Let's Encrypt)",{"type":17,"tag":47,"props":243,"children":244},{},[245,252],{"type":17,"tag":73,"props":246,"children":249},{"href":247,"rel":248},"https://hub.docker.com/r/serversideup/php/tags?name=fpm-apache&page=1&ordering=-name",[77],[250],{"type":23,"value":251},"Our PHP-Apache image",{"type":23,"value":253}," (this is optimized for WordPress)",{"type":17,"tag":47,"props":255,"children":256},{},[257,264],{"type":17,"tag":73,"props":258,"children":261},{"href":259,"rel":260},"https://hub.docker.com/_/mariadb",[77],[262],{"type":23,"value":263},"MariaDB",{"type":23,"value":265}," (the \"non-Oracle\" alternative to MySQL)",{"type":17,"tag":36,"props":267,"children":269},{"id":268},"deploying-updates",[270],{"type":23,"value":271},"Deploying updates",{"type":17,"tag":25,"props":273,"children":274},{},[275,277,282],{"type":23,"value":276},"We attempted to deploy WordPress with rolling updates (like we do with Laravel) by packaging WordPress into a Docker image use the ",{"type":17,"tag":73,"props":278,"children":280},{"href":162,"rel":279},[77],[281],{"type":23,"value":166},{"type":23,"value":283}," framework, but we ran into a ton of issues with community plugins.",{"type":17,"tag":25,"props":285,"children":286},{},[287],{"type":23,"value":288},"Our most stable solution (following \"The WordPress Way\") is to:",{"type":17,"tag":186,"props":290,"children":291},{},[292,306],{"type":17,"tag":47,"props":293,"children":294},{},[295,297,304],{"type":23,"value":296},"Mount ",{"type":17,"tag":298,"props":299,"children":301},"code",{"className":300},[],[302],{"type":23,"value":303},"/var/www/html",{"type":23,"value":305}," of the container to the host",{"type":17,"tag":47,"props":307,"children":308},{},[309,311,317],{"type":23,"value":310},"At the host, run an SSH ",{"type":17,"tag":298,"props":312,"children":314},{"className":313},[],[315],{"type":23,"value":316},"git pull",{"type":23,"value":318}," from our CI system",{"type":17,"tag":25,"props":320,"children":321},{},[322],{"type":23,"value":323},"Ugly, but it works 🤷‍♂️",{"type":17,"tag":36,"props":325,"children":327},{"id":326},"example-repository",[328],{"type":23,"value":329},"Example Repository",{"type":17,"tag":25,"props":331,"children":332},{},[333],{"type":23,"value":334},"We included an example repository that makes it easy for you to clone down and get started.",{"type":17,"tag":25,"props":336,"children":337},{},[338],{"type":17,"tag":73,"props":339,"children":342},{"href":340,"rel":341},"https://github.com/serversideup/docker-wordpress",[77],[343],{"type":23,"value":344},"View the Example WordPress + Docker Repository →",{"title":7,"searchDepth":346,"depth":346,"links":347},2,[348,349,353,354,355,356],{"id":38,"depth":346,"text":41},{"id":85,"depth":346,"text":88,"children":350},[351],{"id":123,"depth":352,"text":126},3,{"id":176,"depth":346,"text":179},{"id":218,"depth":346,"text":221},{"id":268,"depth":346,"text":271},{"id":326,"depth":346,"text":329},"markdown","content:docs:3.guide:4.using-wordpress-with-docker.md","content","docs/3.guide/4.using-wordpress-with-docker.md","md",1727889281224]