I'm building an API usign PHP Laravel and chose docker to do run the server. For some reason, it set the port to be 0.0.0.80, which actually is only allowing me to acces the container through the 127.0.0.1 port at the browser. I couldn't find any helpful tip online to change the container's port because my 'ports' variable at the dockerfile receives ports as lists:
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
If anyone knows how to help I'd be glad to hear. Laravel v = 11.7, I'm already using Docker's latest version.
I attemped changing the ports content to something such as ${APP_PORT:-51}:73 so it would match the the port which docker chose for the laravel.test container, but I guess it has nothing to do with the actual api port. It did ruined the connection to the react app I've made to consume this api so I know it's an important field.
ports:
- '${APP_PORT:-8181}:80'
or add APP_PORT=8181 or any port you want
and then run sail down and then sail up -d