Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile: Run composer install in ENTRYPOINT #4

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_URL=https://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini; \
sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' $PHP_INI_DIR/php.ini;

ENTRYPOINT ["php", "artisan", "octane:start", "--server=frankenphp", "--host=localhost", "--port=443", "--admin-port=2019", "--https"]
ENTRYPOINT ["/bin/sh", "-c" , "composer install && php artisan octane:start --server=frankenphp --host=localhost --port=443 --admin-port=2019 --https"]
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
|
*/

'url' => env('APP_URL', 'http://localhost'),
'url' => env('APP_URL', 'https://localhost'),

'asset_url' => env('ASSET_URL'),

Expand Down