Refactoring

This commit is contained in:
2022-09-05 15:08:24 +02:00
parent 0903e37c08
commit 3f457dcd2e
2 changed files with 13 additions and 8 deletions

View File

@@ -28,6 +28,8 @@
* Laravel Schedule * Laravel Schedule
* Laravel Envoy * Laravel Envoy
* Supervisord * Supervisord
* Node
* NPM
## Simple docker-compose usage: ## Simple docker-compose usage:
@@ -137,13 +139,10 @@ services:
#Project root #Project root
- ./:/var/www/html - ./:/var/www/html
- ~/.ssh:/root/.ssh # If you use private CVS - ~/.ssh:/root/.ssh # If you use private CVS
- ./supervisord:/etc/supervisor/conf.d/ # Supervisor directory, if you want to add more supervisor process config file
- ./php.ini:/usr/local/etc/php/conf.d/php.ini # Optional, your custom php init file - ./php.ini:/usr/local/etc/php/conf.d/php.ini # Optional, your custom php init file
- storage-data:/var/www/html/storage/app #Optional, your custom storage data
environment: environment:
- APP_ENV=development # Optional, or production - APP_ENV=development # Optional, or production
- WORKDIR=/var/www/html #Optional, If you want to use a custom directory #- LARAVEL_PROCS_NUMBER=1 # Optional, Laravel queue:work process number
- LARAVEL_PROCS_NUMBER=3 # Optional, Laravel queue:work process number
#Nginx server #Nginx server
nginx-server: nginx-server:
image: nginx:alpine image: nginx:alpine
@@ -166,7 +165,7 @@ volumes:
``` ```
## Supervisord ## Supervisord
### Add more supervisor process in ### Add supervisor process file in
> /var/www/html/conf/worker/supervisor.conf > /var/www/html/conf/worker/supervisor.conf

View File

@@ -10,7 +10,7 @@ set -e
## Check if the artisan file exists ## Check if the artisan file exists
if [ -f /var/www/html/artisan ]; then if [ -f /var/www/html/artisan ]; then
echo "${Green} artisan file found, creating laravel supervisor config" echo "${Green} artisan file found, creating laravel supervisor config..."
##Create Laravel Scheduler process ##Create Laravel Scheduler process
TASK=/etc/supervisor/conf.d/laravel-worker.conf TASK=/etc/supervisor/conf.d/laravel-worker.conf
touch $TASK touch $TASK
@@ -52,8 +52,14 @@ if [ -f /var/www/html/conf/worker/supervisor.conf ]; then
echo "${Green} If you want to add more supervisor configs, create config file in /var/www/html/conf/worker/supervisor.conf" echo "${Green} If you want to add more supervisor configs, create config file in /var/www/html/conf/worker/supervisor.conf"
echo "${Green} Start supervisor with default config..." echo "${Green} Start supervisor with default config..."
fi fi
## Check if php.ini file exists
if [ -f /var/www/html/conf/php/php.ini ]; then
cp /var/www/html/conf/php/php.ini $PHP_INI_DIR/conf.d/
echo "Custom php.ini file found and copied in $PHP_INI_DIR/conf.d/"
else
echo "Custom php.ini file not found"
echo "If you want to add a custom php.ini file, you add it in /var/www/html/conf/php/php.ini"
fi
echo "" echo ""
echo "**********************************" echo "**********************************"