aschmelyun / fleet

Run multiple Laravel Sail websites locally with custom domain names and https
MIT License
314 stars 13 forks source link

Failure attempting to run 2 laravel applications via sail simultaneously #2

Closed thyseus closed 1 year ago

thyseus commented 1 year ago

I am attempting to run 2 laravel sail applications at the same time.

I did:

laravel new playground
cd playground/
composer require aschmelyun/fleet
php artisan fleet:add
# ...
sail up

and have added a mariadb, redis and mailhog container to playground.localhost

runs fine.

THEN i do:

laravel new playground2
cd playground2/
composer require aschmelyun/fleet
php artisan fleet:add
# ...

same containers, gave i the name playground2.localhost and i get this error message:

❯ sail up
Creating network "playground2_sail" with driver "bridge"
Creating playground2_mariadb_1 ... done
Creating playground2_redis_1   ... done
Creating playground2_mailhog_1 ... done
Creating playground2_playground2-localhost_1 ... 
Creating playground2_playground2-localhost_1 ... error

ERROR: for playground2_playground2-localhost_1  Cannot start service playground2-localhost: driver failed programming external connectivity on endpoint playground2_playground2-localhost_1 (8ad82821873fbd82ca369de190f0f1eab754677142292a1007459c4fcb3d8963): Bind for 0.0.0.0:5173 failed: port is already allocated

ERROR: for playground2-localhost  Cannot start service playground2-localhost: driver failed programming external connectivity on endpoint playground2_playground2-localhost_1 (8ad82821873fbd82ca369de190f0f1eab754677142292a1007459c4fcb3d8963): Bind for 0.0.0.0:5173 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Am i using fleet wrong ?

Thanks a lot!

stephanesoares commented 1 year ago

You need add VITE_PORT with different port at your .env

thyseus commented 1 year ago

@stephanesoares it works ! Thanks a lot. Closing this Issue.

btw: why is this variable called VITE_PORT ?