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
+6-22Lines changed: 6 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ A pretty simplified Docker Compose workflow that sets up a LEMP network of conta
5
5
6
6
To get started, make sure you have[Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system, and then clone this repository.
7
7
8
-
Next, navigate in your terminal to the directory you cloned this, and spin up the containers for the web server by running`docker-compose up -d --buildsite`.
8
+
Next, navigate in your terminal to the directory you cloned this, and spin up the containers for the web server by running`docker-compose up -d --buildapp`.
9
9
10
10
After that completes, follow the steps from the[src/README.md](src/README.md) file to get your Laravel project added in (or create a new blank one).
11
11
12
-
Bringing up the Docker Compose network with`site` instead of just using`up`, ensures that only our site's containers are brought up at the start, instead of all of the command containers as well. The following are built for our web server, with their exposed ports detailed:
12
+
Bringing up the Docker Compose network with`app` instead of just using`up`, ensures that only our site's containers are brought up at the start, instead of all of the command containers as well. The following are built for our web server, with their exposed ports detailed:
13
13
14
14
-**nginx** -`:80`
15
15
-**mysql** -`:3306`
@@ -30,7 +30,7 @@ If you encounter any issues with filesystem permissions while visiting your appl
30
30
**If you are using your server or local environment as the root user:**
31
31
32
32
- Bring any container(s) down with`docker-compose down`
33
-
-Rename`docker-compose.root.yml` fileto`docker-compose.root.yml`, replacing the previous one
33
+
-Replace any instance of`php.dockerfile` in thedocker-compose.yml filewith`php.root.dockerfile`
34
34
- Re-build the containers by running`docker-compose build --no-cache`
35
35
36
36
**If you are using your server or local environment as a user that is not root:**
@@ -54,28 +54,12 @@ volumes:
54
54
- ./mysql:/var/lib/mysql
55
55
```
56
56
57
-
##Using BrowserSync with Laravel Mix
57
+
##Usage in Production
58
58
59
-
If you want to enable the hot-reloading that comes with Laravel Mix's BrowserSync option, you'll have to follow a few small steps. First, ensure that you're using the updated`docker-compose.yml` with the`:3000` and`:3001` ports open on the npm service. Then, add the following to the end of your Laravel project's`webpack.mix.js` file:
60
-
61
-
```javascript
62
-
.browserSync({
63
-
proxy:'site',
64
-
open:false,
65
-
port:3000,
66
-
});
67
-
```
68
-
69
-
From your terminal window at the project root, run the following command to start watching for changes with the npm container and its mapped ports:
70
-
71
-
```bash
72
-
docker-compose run --rm --service-ports npm run watch
73
-
```
74
-
75
-
That should keep a small info pane open in your terminal (which you can exit with Ctrl + C). Visiting[localhost:3000](http://localhost:3000) in your browser should then load up your Laravel application with BrowserSync enabled and hot-reloading active.
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.
76
60
77
61
##MailHog
78
62
79
-
The current version of Laravel (8 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.
63
+
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.
80
64
81
65
To see the dashboard and view any emails coming through the system, visit[localhost:8025](http://localhost:8025) after running`docker-compose up -d site`.