From 11c65c4a006124a1fcaf846710d3516b6ce2023d Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Tue, 12 Jul 2016 15:00:21 +0100 Subject: [PATCH 1/7] Fix variable not set warning Added an untracked `.env` file to the root directory to prevent the `WARNING: The INSTALL_PRESTISSIMO variable is not set` message from being displayed when `docker-compose` is run. Added section in README for optional features. --- .env | 1 + README.md | 8 ++++++++ docker-compose.yml | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 00000000..5b536771 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +INSTALL_PRESTISSIMO=false \ No newline at end of file diff --git a/README.md b/README.md index e4b5f5b1..c8545e4e 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Run a Docker Virtual Host](#Run-Docker-Virtual-Host) - [Find your Docker IP Address](#Find-Docker-IP-Address) - [Use custom Domain](#Use-custom-Domain) + - [Optional Features](#Optional-Features) - [Debugging](#debugging) - [Help & Questions](#Help) @@ -822,6 +823,13 @@ server_name laravel.dev; ``` +
+ +### Optional Features +#### prestissimo +[prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file in the Laradock directory. + +
### Debugging diff --git a/docker-compose.yml b/docker-compose.yml index 087cea3d..9d13ae63 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -156,7 +156,7 @@ services: build: context: ./workspace args: - INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO} + - INSTALL_PRESTISSIMO=${INSTALL_PRESTISSIMO} volumes_from: - application tty: true From d01d0874312b56025c9ceb40135926d3b74ccb36 Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Tue, 12 Jul 2016 16:38:20 +0100 Subject: [PATCH 2/7] Added more detail to the README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8545e4e..bc9d1571 100644 --- a/README.md +++ b/README.md @@ -826,9 +826,10 @@ server_name laravel.dev;
### Optional Features -#### prestissimo -[prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file in the Laradock directory. +Optional features can be enabled by changing the `.env` file in the Laradock directory. +#### prestissimo +[prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file.
From 42d63236f18427a8dce6c5f813e78b9af9dd27c2 Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Tue, 12 Jul 2016 16:39:08 +0100 Subject: [PATCH 3/7] Changed the data container volume mappings All of the database data volume mapping have been changed from the host's `/var/lib` directory to locally alongside the laradock installation. This should hopefully prevent issues where data disappears after containers are restarted or data on the host machine is overwritten by accident (scary!) Additionally this should make data easier to backup between installations - especially on Windows where `/var` does not exist and is created transparently by Docker Machine/Windows beta. This change will most likely cause data to disappear from existing installations, however it may reappear if moved to it's new home. References #137, #138 --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9d13ae63..4a8873f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,13 +27,13 @@ services: data: build: ./data volumes: - - /var/lib/mysql:/var/lib/mysql - - /var/lib/postgres:/var/lib/postgres - - /var/lib/mariadb:/var/lib/mariadb - - /var/lib/memcached:/var/lib/memcached - - /var/lib/redis:/data - - /var/lib/neo4j:/var/lib/neo4j/data - - /var/lib/mongo:/data/db + - ./mysql:/var/lib/mysql + - ./postgres:/var/lib/postgres + - ./mariadb:/var/lib/mariadb + - ./memcached:/var/lib/memcached + - ./redis:/data + - ./neo4j:/var/lib/neo4j/data + - ./mongo:/data/db ### Nginx Server Container ################################## From 14cbe9f935ad97e127a08c2f0f48e1b5afbe5e88 Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Tue, 12 Jul 2016 17:11:57 +0100 Subject: [PATCH 4/7] Moved volume container definitions I've placed the `application` and `data` directories into a `volumes` subdirectory. The top level `data` directory is now used for storing the data used by the database (and other, if any) containers. The `data` directory has also been added to the `.gitignore` file to prevent accidental pushing of user data. --- .gitignore | 1 + docker-compose.yml | 42 +++++++++---------- .../application}/Dockerfile | 0 {data => volumes/data}/Dockerfile | 0 4 files changed, 22 insertions(+), 21 deletions(-) rename {application => volumes/application}/Dockerfile (100%) rename {data => volumes/data}/Dockerfile (100%) diff --git a/.gitignore b/.gitignore index b152f57d..28b085f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /logs +/data .env \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4a8873f9..cebd2138 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: context: ./php-fpm dockerfile: Dockerfile-70 volumes_from: - - application + - volumes_data expose: - "9000" links: @@ -17,30 +17,30 @@ services: ### Laravel Application Code Container ###################### - application: - build: ./application + volumes_source: + build: ./volumes/application volumes: - ../:/var/www/laravel ### Databases Data Container ################################ - data: - build: ./data + volumes_data: + build: ./volumes/data volumes: - - ./mysql:/var/lib/mysql - - ./postgres:/var/lib/postgres - - ./mariadb:/var/lib/mariadb - - ./memcached:/var/lib/memcached - - ./redis:/data - - ./neo4j:/var/lib/neo4j/data - - ./mongo:/data/db + - ./data/mysql:/var/lib/mysql + - ./data/postgres:/var/lib/postgres + - ./data/mariadb:/var/lib/mariadb + - ./data/memcached:/var/lib/memcached + - ./data/redis:/data + - ./data/neo4j:/var/lib/neo4j/data + - ./data/mongo:/data/db ### Nginx Server Container ################################## nginx: build: ./nginx volumes_from: - - application + - volumes_source volumes: - ./logs/nginx/:/var/log/nginx ports: @@ -54,7 +54,7 @@ services: mysql: build: ./mysql volumes_from: - - data + - volumes_data ports: - "3306:3306" environment: @@ -68,7 +68,7 @@ services: postgres: build: ./postgres volumes_from: - - data + - volumes_data ports: - "5432:5432" environment: @@ -81,7 +81,7 @@ services: mariadb: build: ./mariadb volumes_from: - - data + - volumes_data ports: - "3306:3306" environment: @@ -100,7 +100,7 @@ services: environment: - NEO4J_AUTH=homestead:secret volumes_from: - - data + - volumes_data ### MongoDB Container ####################################### @@ -109,14 +109,14 @@ services: ports: - "27017:27017" volumes_from: - - data + - volumes_data ### Redis Container ######################################### redis: build: ./redis volumes_from: - - data + - volumes_data ports: - "6379:6379" @@ -125,7 +125,7 @@ services: memcached: build: ./memcached volumes_from: - - data + - volumes_data ports: - "11211:11211" links: @@ -158,7 +158,7 @@ services: args: - INSTALL_PRESTISSIMO=${INSTALL_PRESTISSIMO} volumes_from: - - application + - volumes_data tty: true ### Add more Containers below ############################### diff --git a/application/Dockerfile b/volumes/application/Dockerfile similarity index 100% rename from application/Dockerfile rename to volumes/application/Dockerfile diff --git a/data/Dockerfile b/volumes/data/Dockerfile similarity index 100% rename from data/Dockerfile rename to volumes/data/Dockerfile From 11cdfd440bda8ee7d527467d3c6f11a59825bd87 Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Tue, 12 Jul 2016 17:46:46 +0100 Subject: [PATCH 5/7] Updated README References #135 --- README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bc9d1571..3dde06fc 100644 --- a/README.md +++ b/README.md @@ -828,8 +828,8 @@ server_name laravel.dev; ### Optional Features Optional features can be enabled by changing the `.env` file in the Laradock directory. -#### prestissimo -[prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file. +#### Prestissimo +[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable Prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file.
@@ -837,24 +837,21 @@ Optional features can be enabled by changing the `.env` file in the Laradock dir *Here's a list of the common problems you might face, and the possible solutions.* -#### + I see a blank (white) page instead of the Laravel 'Welcome' page! +#### I see a blank (white) page instead of the Laravel 'Welcome' page! -run this command from the Laravel root directory: +Run the following command from the Laravel root directory: ```bash sudo chmod -R 777 storage bootstrap/cache ``` -#### + I see "Welcome to nginx" instead of the Laravel App! - -use `http://127.0.0.1` instead of `http://localhost` in your browser. - - - - +#### I see "Welcome to nginx" instead of the Laravel App! +Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) instead of `http://localhost` in your browser. +#### I see an error message containing `address already in use` +Make sure the ports for the services that you are trying to run (80, 3306, etc.) are not being used already by other programs, such as a built in `apache`/`httpd` service or other development tools you have installed.
From 5f99478c763b6b63f4ed72c535d0f89ef911a429 Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Wed, 13 Jul 2016 10:08:13 +0100 Subject: [PATCH 6/7] Fixed workspace container mapping volumes to wrong container --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index cebd2138..e4975759 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -158,7 +158,7 @@ services: args: - INSTALL_PRESTISSIMO=${INSTALL_PRESTISSIMO} volumes_from: - - volumes_data + - volumes_source tty: true ### Add more Containers below ############################### From dca05452937a4672c2f9db1b6fb3e40c64675afa Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Wed, 13 Jul 2016 10:44:17 +0100 Subject: [PATCH 7/7] Fixed incorrect `php-fpm` container mapping --- docker-compose.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e4975759..f7364043 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,19 +2,6 @@ version: '2' services: -### PHP-FPM Container ####################################### - - php-fpm: - build: - context: ./php-fpm - dockerfile: Dockerfile-70 - volumes_from: - - volumes_data - expose: - - "9000" - links: - - workspace - ### Laravel Application Code Container ###################### volumes_source: @@ -49,6 +36,19 @@ services: links: - php-fpm +### PHP-FPM Container ####################################### + + php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + volumes_from: + - volumes_source + expose: + - "9000" + links: + - workspace + ### MySQL Container ######################################### mysql: