From e168cd02854e4f84d645bec297e33085e0b5ae1c Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 9 Feb 2017 17:14:06 -0500 Subject: [PATCH 1/4] Add volume for es ocnfig and plugins; build custom php with dockerfile --- .gitignore | 3 ++- config/elasticsearch/elasticsearch.yml | 0 docker-compose.yml | 7 +++++-- dockerfiles/php-fpm/Dockerfile | 11 +++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 config/elasticsearch/elasticsearch.yml create mode 100644 dockerfiles/php-fpm/Dockerfile diff --git a/.gitignore b/.gitignore index 8badbdc..74dd13c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,5 @@ config.codekit !/data/.gitkeep docker-compose.override.yml -notes.md \ No newline at end of file +notes.md +/config/elasticsearch/plugins/* \ No newline at end of file diff --git a/config/elasticsearch/elasticsearch.yml b/config/elasticsearch/elasticsearch.yml new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index a611b30..db239c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,21 +16,24 @@ services: image: memcached:latest restart: always elasticsearch: - image: elasticsearch:2 + image: elasticsearch:5.2 restart: always ports: - "9200:9200" + volumes: + - "./config/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml" + - "./config/elasticsearch/plugins:/usr/share/elasticsearch/plugins" phpfpm: depends_on: - mysql - memcached - elasticsearch - image: johnpbloch/phpfpm:7.0 volumes: - "./wordpress:/var/www/html" - "./config/php-fpm/php.ini:/usr/local/etc/php/php.ini" - "./config/php-fpm/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini" restart: always + build: ./dockerfiles/php-fpm extra_hosts: - "docker-local.dev:172.18.0.1" nginx: diff --git a/dockerfiles/php-fpm/Dockerfile b/dockerfiles/php-fpm/Dockerfile new file mode 100644 index 0000000..6f8c0b5 --- /dev/null +++ b/dockerfiles/php-fpm/Dockerfile @@ -0,0 +1,11 @@ +FROM johnpbloch/phpfpm:7.0 + +RUN curl -L https://phar.phpunit.de/phpunit.phar > /tmp/phpunit.phar \ + && chmod +x /tmp/phpunit.phar \ + && mv /tmp/phpunit.phar /usr/local/bin/phpunit + +RUN apt-get install -y git subversion wget + +CMD ["php-fpm"] + +EXPOSE 9000 \ No newline at end of file From 1fd103f408575f3a5604883532c08f849ba23456 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 9 Feb 2017 17:15:36 -0500 Subject: [PATCH 2/4] Use root MySQL user --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 0e5b3f3..c45f3f7 100644 --- a/setup.sh +++ b/setup.sh @@ -6,5 +6,5 @@ then else echo "WordPress config file not found. Installing..." docker-compose exec --user www-data phpfpm wp core download - docker-compose exec --user www-data phpfpm wp core config --dbhost=mysql --dbname=wordpress --dbuser=wordpress --dbpass=password + docker-compose exec --user www-data phpfpm wp core config --dbhost=mysql --dbname=wordpress --dbuser=root --dbpass=password fi \ No newline at end of file From cea5f195c463683dc15e286252f93cba3f2ca174 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 9 Feb 2017 17:20:41 -0500 Subject: [PATCH 3/4] Add better instructions to readme --- readme.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index ac2649b..e01a75d 100644 --- a/readme.md +++ b/readme.md @@ -4,10 +4,9 @@ 1. `git clone git@github.com:cmmarslender/docker-template.git ` 1. `cd ` 1. `docker-compose up` +1. Run `bash setup.sh` to download WordPress and create a `wp-config.php` file. -The `wordpress` folder is configured as the webroot by default. Download WordPress and anything else you need here. - -## Overrides File +## Docker Compose Overrides File I typically add a `docker-compose.override.yml` file alongside the docker-compose.yml file, with contents similar to the following to change the domain associated with the cluster while retaining ability to pull in changes from the repo. From a8164d45a3c550978d345f7cb150ef07aa56a3f6 Mon Sep 17 00:00:00 2001 From: Taylor Lovett Date: Thu, 9 Feb 2017 17:27:13 -0500 Subject: [PATCH 4/4] Use es 5 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index db239c4..aa91386 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: image: memcached:latest restart: always elasticsearch: - image: elasticsearch:5.2 + image: elasticsearch:5 restart: always ports: - "9200:9200"