Q:

expose container port in user define bridge network

I am creating a nginx container from dockerfile as shown below.
I have performed following sequence of steps.

Dockerfile content

FROM nginx
COPY . /usr/share/nginx/html
EXPOSE 80

Build docker image from Dockerfile

docker build -t mynginx

create user defined "bridge" network "my-bridge"

docker network create  my-bridge

create nginx container in "my-bridge" network and exposed port 80 of nginx to 
8084 port of host

docker run -itd --network my-bridge --name mynginxcontainer -p 8084:80  mynginx /bin/bash

when i try to access container using host port then nginx is not accesible

http://Public_IP_OF_EC2:8084
So the question is why am I not able to access nginx using host's port?

A:

All steps looks good except docker run 
you are providing /bin/bash as entrypoint which overwrites existing CMD for nginx.  
Kindly start without /bin/bash should be working or provide valid entrypoint which start nginx service inside container.

