Code Monkey home page Code Monkey logo

docker-wordpress-seed's Introduction

Docker WordPress Seed

Requirements

Docker is used for setting up the php & mysql environment. if possible, it will be a powerful development-deployment pipeline. The Docker Machine will be easy to use the Docker in OS which is not CoreOS.

NodeJS, modern frontend development must to be required. The NVM will be helpful for managing NodeJS environment.

Usage

Only for Mac OS user, Homebrew will be useful to install development tools.

Setup Docker Environment

$ brew install docker-machine

Then. VirtualBox are needed too.

$ docker-machine create -d virtualbox dev
$ docker-machine env dev

If the OS be restarted, re-run:

$ docker-machine start dev
$ docker-machine env dev

Finally, we can use docker now.

Node Environment

$ brew install nvm
$ nvm install 0.12

That's all.

Start WordPress and MySQL

Docker Compose is a

$ brew install docker-compose

And path to project folder

$ docker-compose build && docker-compose up

or

$ npm start

Enter an docker container

$ docker ps
$ docker exec -it <CONTAINER_ID> bash  

Notice: docker port forwarding is only about the docker machine and it's containers

If we want to access localhost with some port, we need to set the port forwarding in virtual box, to make the port could be usable in OS.

$ VBoxManage controlvm <DOCKER_MACHINE_NAME> natpf1 "<PORT_NAME>,tcp,127.0.0.1,<PORT>,,<PORT>"

We can use like below. if the docker machine is not running, user modifyvm instead of controlvm

$ VBoxManage controlvm dev natpf1 "tcp-port-3306,tcp,127.0.0.1,3306,,3306"
$ VBoxManage controlvm dev natpf1 "tcp-port-8080,tcp,127.0.0.1,8080,,8080"

In this project, we could run ./bin/virtualbox-port-forwarding.sh to fix it.

Start Frontend Development

$ npm install -g gulp

And path to project folder

$ npm install 
$ gulp dev

Of course, make sure the wordpress and mysql is running.

Then, open http://127.0.0.1:8080/

docker-wordpress-seed's People

Watchers

 avatar  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.