You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,26 @@ volumes:
58
58
59
59
While I originally created this template for local development, it's robust enough to be used in basic Laravel application deployments. The biggest recommendation would be to ensure that HTTPS is enabled by making additions to the`nginx/default.conf` file and utilizing something like[Let's Encrypt](https://hub.docker.com/r/linuxserver/letsencrypt) to produce an SSL certificate.
60
60
61
+
##Compiling Assets
62
+
63
+
This configuration should be able to compile assets with both[laravel mix](https://laravel-mix.com/) and[vite](https://vitejs.dev/). In order to get started, you first need to add` --host 0.0.0.0` after the end of your relevant dev command in`package.json`. So for example, with a Laravel project using Vite, you should see:
64
+
65
+
```json
66
+
"scripts": {
67
+
"dev":"vite --host 0.0.0.0",
68
+
"build":"vite build"
69
+
},
70
+
```
71
+
72
+
Then, run the following commands to install your dependencies and start the dev server:
73
+
74
+
-`docker-compose run --rm npm install`
75
+
-`docker-compose run --rm --service-ports npm run dev`
76
+
77
+
After that, you should be able to use`@vite` directives to enable hot-module reloading on your local Laravel application.
78
+
79
+
Want to build for production? Simply run`docker-compose run --rm npm run build`.
80
+
61
81
##MailHog
62
82
63
83
The current version of Laravel (9 as of today) uses MailHog as the default application for testing email sending and general SMTP work during local development. Using the provided Docker Hub image, getting an instance set up and ready is simple and straight-forward. The service is included in the`docker-compose.yml` file, and spins up alongside the webserver and database services.