-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile: Run composer install in ENTRYPOINT
I realised going through the docs the getting started steps on a fresh project didn't work, there were a couple of issues: 1. The .env wasn't being created 2. The composer:latest used to do the initial "composer install" uses PHP8.2 but the project requires PHP8.3 so it fails. It makes much more sense to do the "composer install" as part of the initial "docker-compose up" meaning one less step for the developer.
- Loading branch information
1 parent
e3fcc6b
commit 106c542
Showing
4 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ This is a modern, strict, strongly typed Laravel application skeleton that can b | |
|
||
You should ensure that you have the following installed on your host machine: | ||
|
||
* Git | ||
* Docker | ||
* Docker-compose | ||
* pnpm v8 | ||
|
@@ -40,28 +41,34 @@ Front end: | |
|
||
## Getting started | ||
|
||
1. Install front end dependencies: | ||
```shell | ||
pnpm install | ||
``` | ||
1. Clone this repo: | ||
```shell | ||
git clone [email protected]:philbates35/laravel-starter.git example-project | ||
cd example-project | ||
``` | ||
|
||
2. Run the Vite dev server: | ||
2. Create the `.env` file: | ||
```shell | ||
cp .env.example .env | ||
``` | ||
|
||
3. Install composer dependencies, then start Octane (FrankenPHP): | ||
```shell | ||
pnpm run dev | ||
docker-compose up -d | ||
``` | ||
|
||
3. Install composer dependencies: | ||
4. Install front end dependencies: | ||
```shell | ||
docker run --rm -it -u $(id -u $USER) -v $PWD:/app composer:latest composer install | ||
pnpm install | ||
``` | ||
|
||
4. Start Octane (FrankenPHP): | ||
5. Run the Vite dev server: | ||
|
||
```shell | ||
docker-compose up -d | ||
pnpm run dev | ||
``` | ||
|
||
5. Go to https://localhost/, accept the potential security risk (it's a self-signed certificate), and you should see the Laravel welcome page. | ||
6. Go to https://localhost/, accept the potential security risk (it's a self-signed certificate), and you should see the Laravel welcome page. | ||
## Cheat sheet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters