Created new docker-vagrantpress
A development environment for WordPress
This commit is contained in:
parent
d46dd4b554
commit
86e6f5315f
4 changed files with 73 additions and 0 deletions
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
.vagrant
|
||||
.DS_Store
|
||||
src/index.php
|
||||
src/plugins/hello.php
|
||||
src/plugins/index.php
|
||||
src/plugins/akismet
|
||||
|
||||
src/themes/index.php
|
||||
src/themes/twentyfourteen
|
||||
src/themes/twentyfifteen
|
||||
src/themes/twentysixteen
|
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# docker-vagrantpress
|
||||
|
||||
This a wordpress development environment which uses Docker inside a Vagrant VM.
|
||||
|
||||
I have created this mainly to see how Docker works and to try and get something faster than my current [Vagrant + Puppet setup](https://github.com/hyettdotme/vagrantpress)
|
||||
|
||||
# Prerequisites
|
||||
+ [Vagrant](http://www.vagrantup.com/downloads.html)
|
||||
+ [Virtualbox](https://www.virtualbox.org/wiki/Downloads)
|
||||
+ [Vagrant Hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
|
||||
+ [Vagrant-Docker-Compose](https://github.com/leighmcculloch/vagrant-docker-compose)
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Clone the project. (There’s only master branch.)
|
||||
2. Run `vagrant plugin install vagrant-hostsupdater` from command line
|
||||
3. Run `vagrant plugin install vagrant-docker-compose` from command line
|
||||
4. Run the command `vagrant up` from the directory
|
||||
5. Open your browser to http://www.docker.dev and go through the WordPress installation wizard
|
||||
|
||||
A src folder will be created by docker which contains a plugins and themes folder which can be used for development.
|
24
Vagrantfile
vendored
Normal file
24
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
config.vm.box = "trusty64"
|
||||
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
|
||||
|
||||
# setup virtual hostname and provision local IP
|
||||
config.vm.hostname = "docker.dev"
|
||||
config.vm.network :private_network, :ip => "192.168.50.4"
|
||||
config.hostsupdater.aliases = %w{www.docker.dev}
|
||||
config.hostsupdater.remove_on_suspend = true
|
||||
|
||||
config.vm.provision :docker
|
||||
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", run: "always"
|
||||
|
||||
# Fix for slow external network connections
|
||||
config.vm.provider :virtualbox do |vb|
|
||||
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
|
||||
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']
|
||||
end
|
||||
end
|
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
web:
|
||||
image: wordpress
|
||||
links:
|
||||
- mysql
|
||||
environment:
|
||||
- WORDPRESS_DB_PASSWORD=password
|
||||
ports:
|
||||
- 80:80
|
||||
working_dir: /var/www/html
|
||||
volumes:
|
||||
- /vagrant/src/:/var/www/html/wp-content
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=password
|
||||
- MYSQL_DATABASE=wordpress
|
Loading…
Reference in a new issue