From cfc48b37911f95bba76fd187b8cc8c7bd2cebe0f Mon Sep 17 00:00:00 2001 From: philtrep Date: Mon, 3 Oct 2016 13:06:31 -0400 Subject: [PATCH 1/5] Added NVM binaries in root bashrc --- workspace/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 9e9baad4..303836c0 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -165,6 +165,14 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add NVM binaries to root's .bashrc +USER root +RUN if [ ${INSTALL_NODE} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export NVM_DIR="/home/laradock/.nvm"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ +;fi + ##################################### # PHP Aerospike: ##################################### From ec3ebb9701de24d9c64d567c786a1601a5626f2d Mon Sep 17 00:00:00 2001 From: philtrep Date: Mon, 3 Oct 2016 13:23:24 -0400 Subject: [PATCH 2/5] Remove port fowarding for MySQL and MariaDB --- docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e9170fb1..8b81cd05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,8 +104,6 @@ services: build: ./mysql volumes_from: - volumes_data - ports: - - "3306:3306" environment: MYSQL_DATABASE: homestead MYSQL_USER: homestead @@ -131,8 +129,6 @@ services: build: ./mariadb volumes_from: - volumes_data - ports: - - "3306:3306" environment: MYSQL_DATABASE: homestead MYSQL_USER: homestead From 6f435584a9166062c5ac65617df5fb3568740270 Mon Sep 17 00:00:00 2001 From: philtrep Date: Mon, 3 Oct 2016 20:08:54 -0400 Subject: [PATCH 3/5] Added cron files copying to workspace crontab --- README.md | 12 ++++++++++++ workspace/Dockerfile | 6 ++++++ workspace/crontab/.gitkeep | 0 3 files changed, 18 insertions(+) create mode 100644 workspace/crontab/.gitkeep diff --git a/README.md b/README.md index 1a94f961..1b8db4fa 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Production](#Production) - [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean) - [Misc](#Misc) + - [Cron jobs](#CronJobs) - [Use custom Domain](#Use-custom-Domain) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Install Prestissimo](#Install-Prestissimo) @@ -936,6 +937,17 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
+ + +### Adding cron jobs + +Add a root file containing the cron jobs in `workspace/crontab`. + +``` +# workspace/crontab/root +* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 +``` + ### Use custom Domain (instead of the Docker IP) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 303836c0..c63f90b1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -198,6 +198,12 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ rm /etc/php/7.0/cli/conf.d/aerospike.ini \ ;fi +##################################### +# Crontab +##################################### +USER root +COPY ./crontab /var/spool/cron/crontabs + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/crontab/.gitkeep b/workspace/crontab/.gitkeep new file mode 100644 index 00000000..e69de29b From 8933b827b377c4c8ee3eaa73def75fa5e419353d Mon Sep 17 00:00:00 2001 From: philtrep Date: Mon, 3 Oct 2016 20:27:46 -0400 Subject: [PATCH 4/5] Added laravel cronjob --- README.md | 6 ++++-- workspace/crontab/.gitkeep | 0 workspace/crontab/root | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 workspace/crontab/.gitkeep create mode 100644 workspace/crontab/root diff --git a/README.md b/README.md index 1b8db4fa..0f3b20e0 100644 --- a/README.md +++ b/README.md @@ -941,10 +941,12 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the ### Adding cron jobs -Add a root file containing the cron jobs in `workspace/crontab`. +You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. ``` -# workspace/crontab/root +* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1 + +# Custom cron * * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 ``` diff --git a/workspace/crontab/.gitkeep b/workspace/crontab/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/workspace/crontab/root b/workspace/crontab/root new file mode 100644 index 00000000..c09ea2aa --- /dev/null +++ b/workspace/crontab/root @@ -0,0 +1 @@ +* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1 \ No newline at end of file From 8d620707737871a3bae421b9a9b975aacb711d6c Mon Sep 17 00:00:00 2001 From: Rogerio Prado de Jesus Date: Mon, 3 Oct 2016 23:51:48 -0300 Subject: [PATCH 5/5] Fix typo in README: Giude -> Guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a94f961..c25a7632 100644 --- a/README.md +++ b/README.md @@ -924,7 +924,7 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the ### Setup Laravel and Docker on Digital Ocean -####[Full Giude Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md) +####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md)