Running multiple Laravel apps locally with Docker

preview_player
Показать описание

In this 13 minute video, I'll show you how to run two separate Laravel applications using local Docker networks and communicate between them.

You'll learn how to:

- Configure docker-compose files for each app
- View each separate Laravel application in the browser
- Create a shareable bridge network in Docker
- Make an API call between apps using a Docker service hostname

Thanks Patreon supporters!
- Sam Ross
- PK
- Melissa Kipp

Рекомендации по теме
Комментарии
Автор

Your videos are helping me tremendously. Thank you so much for doing these. Hopefully you gain more subscribers since your videos are well made, easily understood and of high quality. More powers to you!

itsMeSteveinix
Автор

I am starting to transition to docker env and these videos are gold

vabalokis
Автор

Great video and thank you. I will be trying this out.

memack
Автор

Great tutorial.
With docker compose version 3.5 you can set network name. So you don't need to checl for it in app-two:
networks:
laravel:
app-shared:
driver: bridge
name: app-shared

gorazdveselic
Автор

man this quick run is such a relief for the brain

aascape
Автор

And again... Another video on point... Thank you

JohnnyBigodes
Автор

This is really helpfull, thank you so much!

Khaos
Автор

This is really helpfull, thank you so much!
but my question is: should I share some containers like npm when multiple apps? and if I have 5 apps, I must build and run 5 group of all nginx/mysql/npm/composer/and any other containers that might run out of my server resources

richardfan
Автор

Very helpful video! That would be great if you could show how to deploy multiple (laravel) apps in a VPS using docker containers!

kasramy
Автор

Thanks sir. This was a very good example on running microservices. Hopefully you can also add the tutorial for adding the domain. Also, is it possible to only access the second docker with only one authentication from the other one? Thank you :)

dhonxeanbobis
Автор

When using App_2 as the API for App_1 does it need to go through the web.php route? Could that that take place instead in the api.php?

tannercampbell
Автор

Hi Andrew,
How do you create and install a self-signed wildcard cert for browser with cert.sh ?

bernardchisumo
Автор

Hey Andrew, Thanks for making this tutorial. It helps me a lot.
I'm running Laravel and WordPress following your process. But in the WordPress system, sometimes I get "File not found" on the browser page reload.
Can you please help me with that?

keramotulislam
Автор

Can i use this docker compose config in production ?

youssoufouyabre
Автор

just discovered your channel and I really enjoy your videos. Can't wait for you to discover traefik, I assumed this would be the subject of this video (I personnaly use it to run multiples stacks on my dev laptops) ! But hey, still some awesomeness for you to discover !


On a more important note, I would probably adress the very common issue of users difference between the host and the container, I've noted a comment related to this under this video.
i for one add two arguments to the build section of my docker-compose :
args:
user: laurent
uid: 1000
That I use in the Dockerfile
FROM php:8-fpm

# Arguments defined in docker-compose.yml
ARG user
ARG uid
.... blah blah blah install some cool stuff ...
RUN useradd -G www-data, root -u $uid -d /home/$user $user
RUN chown -R $user:$user /home/$user

WORKDIR /var/www

USER $user

This way both users in the host and the container share the same name and the same id, preventing permissions errors for files created inside the container (like logs or cache files) with the default root user's id 1.

laurentcochet
Автор

Why my container is so slow when load page, over 4 -> 5s, i tested with project laravel 8.x default. Please help me! Thank you so much

izclubcom
Автор

Awesome ! Could you show us how to forward to some domain?

aArcziMetin
Автор

hi, is it possible to instead of using localhost to use the name of your domain
I can do that on ubuntu in etc/hosts
but in mac?

Paltibenlaish
Автор

Nice videos!! I hope you could do one for ssh access directly! Thank you man!

ahmadabuaysheh
Автор

How do we use bash for second MySQL service

sujithm.p