Skip to content

Commit

Permalink
fixing mandatory lumen folders
Browse files Browse the repository at this point in the history
  • Loading branch information
leodisarli committed Dec 2, 2023
1 parent 2259ab9 commit 5ba3671
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ Run [Composer](https://getcomposer.org/) to install all dependencies.
composer install --prefer-dist
```

Ensure the folder ./storage are with all rights to save log and cache (alread set in composer install, but ...)
Ensure the composer install create the cache folders and give then permissions in ./storage, if don't you'll have to create and give permitions yourself:
```sh
chmod -R 777 ./storage
mkdir storage/framework \
&& mkdir storage/framework/cache \
&& mkdir storage/framework/cache/data \
&& mkdir storage/framework/sessions \
&& mkdir storage/framework/views \
&& chmod -R 777 ./storage
```

To check the build for this project look at ./ops/docker/dev folder.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"scripts": {
"post-install-cmd": [
"chmod -R 777 storage"
"./ops/folders.sh"
],
"checkall" : [
"@lint",
Expand Down
1 change: 0 additions & 1 deletion ops/docker/prod/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ RUN tar -xvf /usr/src/newrelic-php5-9.21.0.311-linux.tar.gz -C /usr/src && \

COPY . /var/www/html


WORKDIR /var/www/html

EXPOSE 9000
Expand Down
32 changes: 32 additions & 0 deletions ops/folders.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

DIR1="storage/framework"
DIR2="storage/framework/cache"
DIR3="storage/framework/cache/data"
DIR4="storage/framework/sessions"
DIR5="storage/framework/views"


if [ ! -d "$DIR1" ]; then
mkdir "$DIR1"
echo "folder $DIR1 created"
fi
if [ ! -d "$DIR2" ]; then
mkdir "$DIR2"
echo "folder $DIR2 created"
fi
if [ ! -d "$DIR3" ]; then
mkdir "$DIR3"
echo "folder $DIR3 created"
fi
if [ ! -d "$DIR4" ]; then
mkdir "$DIR4"
echo "folder $DIR4 created"
fi
if [ ! -d "$DIR5" ]; then
mkdir "$DIR5"
echo "folder $DIR5 created"
fi

chmod -R 777 storage
echo "permissions set on storage"

0 comments on commit 5ba3671

Please sign in to comment.