* 'master' of https://github.com/LaraDock/laradock:
  Fix typo in README: Giude -> Guide
  Added laravel cronjob
  Added cron files copying to workspace crontab
  Remove port fowarding for MySQL and MariaDB
  Added NVM binaries in root bashrc
This commit is contained in:
Mahmoud Zalt 2016-10-06 17:57:18 -04:00
commit e9af2a4fb3
4 changed files with 30 additions and 5 deletions

View File

@ -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)
@ -924,7 +925,7 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<a name="Digital-Ocean"></a>
### 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)
@ -936,6 +937,19 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<br>
<a name="CronJobs"></a>
### Adding cron jobs
You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line.
```
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1
# Custom cron
* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
```
<a name="Use-custom-Domain"></a>
### Use custom Domain (instead of the Docker IP)

View File

@ -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

View File

@ -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:
#####################################
@ -190,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

1
workspace/crontab/root Normal file
View File

@ -0,0 +1 @@
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1