A simple Docker based development environment for PHP with some installer scripts for *NIX.
If you are using *NIX system and just want to develop a theme with WordPress, consider refer to this repo http://github.com/lbngoc/sage-8-webpack
- Docker
- docker-compose
- NodeJS, NPM (for running scripts cross platforms)
- Nginx
- PHPFPM
- MySQL
- Memcached (*)
- Elasticsearch (*)
- Mailcatcher (*)
(*) Disabled by default in docker-compose.yml
- SSH to docker container:
npm run ssh
ornpm run ssh-root
- Install WordPress:
npm run setup-wordpress
- Install Roots Bedrock:
npm run setup-bedrock
- Backup MySQL databse:
npm run mysql-backup
- Restore MySQL database:
npm run mysql-restore
Need more scripts ? Just create new request here.
-
Create new project, remember to edit
<your_project_name>
- NPM (Windows, OSX, Linux)
$ npm install -g create-project $ create-project <your_project_name> lbngoc/php-docker-dev
- Git & Bash (*NIX)
$ PROJECT_NAME=<your_project_name>; \ git clone [email protected]:lbngoc/php-docker-dev.git $PROJECT_NAME; \ cd $PROJECT_NAME; rm -rf .git
-
Init source code
-
For existing source code, just copy it to
public_html
-
To setup to new website, you can use built-in setup scripts.
-
-
Start docker container
docker-compose up
-
Navigate to
http://localhost
in a browser to open your project.-
If you want to use a domain other than
http://localhost
, you'll need to:-
Add an entry to your hosts file. Ex:
127.0.0.1 your_domain.dev
-
Update
docker-local.dev
indocker-compose.yml
and restart docker container.
-
-