I have the following problem in Windows 10 (in Ubuntu works properly):
I'm working in Laravel 8 with Sail
When I create the APP_PORT
variable on .env
...
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_PORT=3000
...and launch the web with sail up
I get this error:
services.laravel.test.ports contains an invalid type, it should be a number, or an object
This is how the docker-compose.yml
looks
version: '3'
services:
laravel.test:
build:
context: ./docker/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.0/app
ports:
- '${APP_PORT:-80}:80'
...
I know that I could just put ports: - '3000:80'
but since I'm working in team and the php artisan sail:install
command will overwrite the docker-compose.yml
file I don't wanna change the docker-compose.yml
file.
Thanks in advance.
${APP_PORT:-80}:80
here${APP_PORT:-80}
this is container port which will be 8000 asphp artisan serve
run on that port and80
is you local machine port i think you want to change your local machine port ? – Okie- '${APP_PORT:-80}:${APP_CLIENT_PORT}'
and create a new in.env
be likeAPP_CLIENT_PORT=3000
– Okiedocker(HOST)
your machine is client – Okie