support for node

This commit is contained in:
Shihaam Abdul Rahman 2024-09-08 05:37:18 +05:00
parent 811c6d45b4
commit b9b534b63c
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

17
helper
View File

@ -2,11 +2,7 @@
# Function to handle PHP Artisan commands
php() {
if [[ "$1" == "artisan" ]]; then
docker compose exec fpm php artisan "${@:2}"
else
echo "Unknown php command"
fi
docker compose exec fpm "${@}"
}
# Function to handle Composer commands
@ -28,6 +24,11 @@ fix_storage() {
docker compose exec fpm chmod -R ug+x bootstrap/cache
}
# Function to handle NPM commands
npm() {
docker compose exec node npm "${@}"
}
# Function to initialize the composer.yml file
init() {
cat <<EOL > composer.yml
@ -61,6 +62,12 @@ services:
- MYSQL_DATABASE=cusport
volumes:
- ./.db:/var/lib/mysql
node:
hostname: node
image: node:lts
volumes:
- ./:/var/www/html/
working_dir: /var/www/html
EOL
echo "composer.yml file created successfully!"
}