Saya sudah mencoba mengekspos nginx port untuk dapat mengakses halaman dengan ip eksternal.
Saya sudah mencoba mengekspos port 80 dengan:
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
Tapi tidak ada yang berubah:
tcp6 0 0 :::80 :::* LISTEN 7008/docker-proxy
Dokumentasi Laradock tidak jelas tentang masalah ini.
Saya juga menemukan bahwa Anda dapat mengekspos port dengan perintah
docker run --expose=80 nginx
Tetapi selalu mengatakan tidak dapat menemukan gambar dan mulai membangunnya.
Jawaban:
You're using a project which uses a quite complex docker setup. Docker compose is used to start a whole bunch of containers if you look at the compose file for the project.
Docker itself supports quite a few different networking modes and you might want to check out the docker documentation to learn about it. Especially the docker container networking article can be quite insightful as it explains the default networking behavior.
Have a look at the nginx configuration for that project and check the nginx entry and the env file for the project. You will find that compose file already contains a ports section that, according to the compose configuration documentation, publishes the port for your local network and uses bridged networking.
What you will need to do is either change the docker network configuration to suite your needs or change your host configuration to provide actual routing (e.g. 1 could be relevant) or, probably easier, run a reverse proxy for your docker application ... you could do this using a docker container.
sumber