https://github.com/runthis/laravel-9-docker
Ready to use docker template for local development using Laravel 9.
https://github.com/runthis/laravel-9-docker
Last synced: 3 months ago
JSON representation
Ready to use docker template for local development using Laravel 9.
- Host: GitHub
- URL: https://github.com/runthis/laravel-9-docker
- Owner: runthis
- Created: 2022-02-17T02:22:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T08:47:38.000Z (almost 2 years ago)
- Last Synced: 2025-03-03T22:11:18.518Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 4.37 MB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel 9 Docker Template
[](https://github.com/runthis/laravel-9-docker/actions/workflows/php.yml)
This is a docker template for local development using [Laravel 9](https://laravel.com/docs/9.x). It is *opinionated* and using [Laravel Socialite](https://laravel.com/docs/9.x/socialite) with pre-setup Google Authentication. You should [setup credentials in google](https://console.cloud.google.com/apis/credentials?) and then add the following keys to your `.env` file *(not the other .env.* files)* so you can authenticate through Google, or don't and roll your own:
GOOGLE_CLIENT_ID="clientidhere.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="secrethere"
## Setup
**1. Clone the repo**
`git clone git@github.com:runthis/laravel-9-docker.git laravel-9-docker && cd laravel-9-docker`
**2. Build the container**
`npm run container:build`
## Alternatively, setup for your own repo
**1. Click "Use this template" in Git**
**2. Build the container**
Bring your code down locally from your own repo and then run:
`npm run container:build`
## Access
**Open the browser and see "hello world"**
`http://localhost:3005/`
**Use PHPMyAdmin if you want**
`http://localhost:3010/`
## Useful commands
This is not an exhaustive list. Use `npm run` to see a list of all commands.
| Command | Description |
|--|--|
| `npm run composer` | Run composer commands |
| `npm run artisan` | Run artisan commands |
| `npm run shell` | Access the container |
| `npm run dev` | Quickly build the frontend |
| `npm run prod` | Build the frontend for production |
| `npm run migrate` | Run database migrations |
| `npm run migrate:undo` | Undo the last migration |
| `npm run migrate:refresh` | Wipe and redo database migrations |
| `npm run test` | Run unit/feature tests |
| `npm run phpcs` | Run phpcs tests |
*Additionally commands can be run using `docker-compose exec` for example
`docker-compose exec laravel php -i` will show PHP info.*
## Future updates
I will update this from time to time to resolve security issues / vendor updates. Although it is unlikely I'll add specifically new features, but rather use this template as a blank slate / baseline to create new Laravel packages that can be used as vendors. Will update this readme if/when a new package created is compatible with this repo.