Beginner to Intermediate.
A container may listen on port 8000, but that does not automatically make it reachable from the host.
Map a host port:
docker run -p 8080:8000 my-api:v1Traffic path:
host:8080 -> container:8000
Container writable storage is disposable.
Use a volume for data that should survive container replacement:
docker run -v app-data:/data my-api:v1- reversing host and container ports
- storing database data only inside the container
- mounting over files required by the image
- assuming
EXPOSEpublishes a port