It's a short guide about how to setup browsersync in Laravel inside Docker
-
Install all needed to get the BrowserSync working with gulp and Laravel. You can get all details here: Browser-sync
-
Setup your proxy according the IP address of your docker container:
elixir(function(mix) {
mix.browserSync({
proxy: 'https://192.168.99.100',
notify: false
});
});
Run in terminal: gulp watch
It will show you details about the host and the port. Note the port number.
- Open
Kitematic
(that was with Docker) and follow the instructions below:
- Select the container that you want to get Browsersync working.
-
The last settings is just ADD the port (that you got when running
gulp watch
to the red rectangles, according the image)
The last step is simple click on the Save button access your website trough the docker-ip:port/url
http://192.168.99.100:3000/
OBS: Replace the 192.168.99.100 IP by your Docker IP