Skip to content

Commit c499434

Browse files
committed
Try initializing the repo with RUN
ENDPOINT crashes CoseSpaces, it's been reported by several users Change the readme to remind people that Laravel does require some initializations edit .sh file to not lunch PHP-FPM after composer install
1 parent 56b4093 commit c499434

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.devcontainer/.docker/php/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ RUN mv composer.phar /usr/local/bin/composer
6262
WORKDIR /var/www/htdoc
6363

6464
# start out script that runs composer install, but ONLY if /vendor/ does not exist
65+
RUN chmod +x /var/www/htdoc/init_repo.sh
6566
#ENTRYPOINT ["/var/www/htdoc/init_repo.sh"]

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,35 @@ The article mentions several ways to get a Laravel development environment up an
1515

1616
# Preparing the Laravel project to run
1717

18-
## Dependencies
18+
Before the project can run properly, we need to take several actions.
19+
20+
## 1. Install dependencies
1921

2022
In the Laravel project folder, install the Composer dependencies with the command
2123

2224
`composer install`
2325

24-
## .env file
26+
## 2. Create the .env file
2527

2628
Laravel uses the .env file for environment-specific configurations, like database credentials, application key, and other settings. Create one from the included example file:
2729

2830
`cp .env.example .env`
2931

30-
#### Application key
32+
## 3. Generate a Laravel Application key
3133

3234
Laravel might ask to generate a new application key. You can do it by running this command in the laravel project folder.
3335

3436
`php artisan key:generate`
3537

36-
#### MongoDB connection string
38+
## 4. Add the MongoDB connection string to .env
3739

38-
Not included in this repo is the Laravel .env file that contains the MongoDB connection string with the username / password. You'll have to make a cope of the .env.example file and add this variable:
40+
We need to add the MongoDB connection string with the username / password to the .env file. add this line, but remember that your connection string might look different.
3941

40-
`DB_URI=`
42+
`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority`
4143

42-
The complete URI looks like this:
44+
## 5. Ready!
4345

44-
`DB_URI=mongodb+srv://USERNAME:PASSWORD@clustername.subdomain.mongodb.net/?retryWrites=true&w=majority`
46+
Head to the site URL and you should see the Laravel Homepage
4547

4648
# Xdebug
4749

src/init_repo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ if [ ! -d "vendor" ]; then
1313
fi
1414

1515
# Then, execute the main command, e.g., starting PHP-FPM
16-
exec php-fpm
16+
# exec php-fpm

0 commit comments

Comments
 (0)