How do I access Django running on a Google Compute Engine VM from my browser?
I have found the solution after a bit more trial-and-error. It was not very intuitive so I'll post here in case I can help anyone else.
What fixed the issue for me was exposing the port (8000) on the command line when running the app's container:
docker run -p 8000:8000 ...
The reason this eluded me for so long was because I already expose the port in the Dockerfile: EXPOSE 8000, and when I run docker ps to list the ports exposed on each container, the container appeared to already be port-exposed: 8000/tcp. However, what I didn't know is that it is supposed to look like: 0.0.0.0:8000->8000/tcp.
Anyways, hope this helps someone else out.
I have a Django dashboard application I wish to view from my browser. Django is running in a Docker container on one of Google's Compute Engine instances. The GCE instance is on a Google VPC, on which I've added firewall rules to open Django's port 8000. I've added my IP to Django's ALLOWED_HOSTS in settings.py. The container's logs indicate that it is running fine, yet when I access the GCE instance's IP from my browser, I am immediately unable to connect. I can ping the instance from my command line just fine. Is there something I'm missing here? Been stuck on this for a few hours now.
Note: I have the Django container running on a "Docker network" in order for Celery to communicate with a RabbitMQ container. This was recommended to me somewhere, but I am unfamiliar with Docker networks or if they are causing the issue.