Coder Social home page Coder Social logo

jp3pe / wp-cli-with-wordpress-using-docker Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 5 KB

An sample project how to use WP-CLI, WordPress and MySQL with Docker.

License: MIT License

Dockerfile 100.00%
docker dockerize dependency wordpress wordpress-cli container docker-compose dockerfile wp-cli

wp-cli-with-wordpress-using-docker's Introduction

WP-CLI with WordPress using Docker

What is this sample?

This repository show how to use WP-CLI to control dependencies between MySQL, WordPress and WP-CLI.

Who should reference this sample?

  1. If you need to make single WordPress environment or multiple WordPress environments.
  2. If you suffered from dependencies between containers.

Background

When I was on one of the member of security project team to find new zero-day vulnerability from CMS, my job was find a way how to create runtime environments easily. I found a docker and it was a perfect tool to do annoying jobs.

But, I faced to dependence problem among WordPress container, WP-CLI container and MySQL container. I must wait my WP-CLI container's job before to finish to build WordPress container and MySQL container. According to Docker reference, depends_on options in docker-compose.yml won't check prepareaiton of each containers. So, When you use WP-CLI, its command may not works correctly.

depends_on does not wait for db and redis to be “ready” before starting web - only until they have been started. If you need to wait for a service to be ready, see Controlling startup order for more on this problem and strategies for solving it.

So I solved dependency problem using third-party tool dockerize. You can communicate with TCP using dockerize. When each container(db, WordPress) are ready, docker-cli starts its command.

wp-cli-with-wordpress-using-docker's People

Contributors

jp3pe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.