# Container says Up, browser gets nothing back? Two part fix

> 0.0.0.0 inside the container, 127.0.0.1 on the -p flag.

Source: https://fullbytedeveloper.com/blog/bindall
Published here: 2026-11-16

Container says Up, browser gets nothing back?

## The problem

Docker Desktop, python:3.12-slim. Server inside the container bound to 127.0.0.1. `curl localhost:8000` returned "curl: (52) Empty reply from server". Chrome showed `net::ERR_EMPTY_RESPONSE`. Same image and port, restarted with the server bound to 0.0.0.0: HTTP 200.

## Part 1: inside the container, listen on all addresses

**Flask:**
```bash
flask run --host=0.0.0.0
```

**Vite:**
```bash
vite --host 0.0.0.0
```

Or just `--host`.

**Python:**
```bash
python -m http.server 8000 --bind 0.0.0.0
```

## Part 2: on your machine, publish only to yourself

```bash
docker run -p 127.0.0.1:5000:5000 your-image
```

Use your server's port on both sides: Flask 5000, Vite 5173, http.server 8000.

## The rule to keep

`0.0.0.0` inside the container, `127.0.0.1` on the `-p` flag.

## Security note

By default Docker binds the forwarded port to your laptop's loopback only, so other devices on your Wi-Fi cannot use it.

Flask warns the debugger can run arbitrary code, so never expose it. My rule: never pair `--host=0.0.0.0` with a plain `-p 5000:5000` on a public server.

Send this to the friend whose Docker container says Up but the browser shows nothing.

## Sources

1. [Flask docs: quickstart](https://flask.palletsprojects.com/en/stable/quickstart/)
2. [Vite docs: server options](https://vite.dev/config/server-options)
3. [Docker docs: port publishing](https://docs.docker.com/engine/network/port-publishing/)
