Access built-in php server from Docker in Host

Asked

Viewed 261 times

0

Good people to studying Docker here and along with this I want to create a php server (by your built-in server) and then access this server from my host machine.

I executed the following command:

docker run -it -p 8080:8080 -v "D:\git\slim-saa:/home" -w "/home" my_opensuse_slim php -S localhost:8080 -t public public/index.php

After executing this command the server runs normally: inserir a descrição da imagem aqui

The doors and volumes are mapped normally (I think kk): inserir a descrição da imagem aqui

But when I go on my machine and access the localhost:8080, I do not access anything: inserir a descrição da imagem aqui

Do you have any idea what I did wrong?

  • Jhonatan, [en.so] has a question and answer structure that differs from a forum. In our structure, the solution of the problem must always be present in the area of answers and never in the question. If you have found the solution on your own, feel free to answer your own question. This is not only allowed but is highly encouraged in our community. I recommend that you read the [tour] to better understand the operation of the site.

  • Done @Andersoncarloswoss Thanks for the tips.

1 answer

0


I found the problem but not the ultimate solution. It turned out that my container-host mapping was right, even problematic was the way I was/am using php’s built-in web server. I installed php+apache normally in the image and when raising the web server everything worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.