Issue on Docker Reverse Proxy

Hi,
I am facing an issue with Port refusal. The Docker compose container is not coming up.
I want to implement Nginx Reverse Proxy and host 2 test websites on it.

Current Scenario:

  1. My (2) website container is running fine. - Container Name: example1_app_1 & example2_app_1
  2. Issue on : proxy_proxy_ container is not up.

I am sharing my output here:

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ cat docker-compose.yml
version: '2'
services:
 proxy:
  build: ./
  networks:
   - example1
   - example2
  ports:
   - 8080:80
   - 443:443

networks:
 example1:
  external:
   name: example1_default
 example2:
  external:
   name: example2_default

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker-compose up -d
Recreating proxy_proxy_1 ... done
ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker ps -a

CONTAINER ID   IMAGE         COMMAND                  CREATED         STATUS                     PORTS                                     NAMES
6bd78438d1c1   proxy_proxy   "/docker-entrypoint.…"   8 seconds ago   Exited (1) 7 seconds ago                                             proxy_proxy_1
665b8a873776   nginx         "/docker-entrypoint.…"   15 hours ago    Up 15 hours                0.0.0.0:49156->80/tcp, :::49156->80/tcp   example2_app_1
4e70245934fb   nginx         "/docker-entrypoint.…"   15 hours ago    Up 15 hours                0.0.0.0:49155->80/tcp, :::49155->80/tcp   example1_app_1

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$
ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker inspect proxy_proxy_1 | grep IPAddress
            "SecondaryIPAddresses": null,
            "IPAddress": "",
                    "IPAddress": "",
                    "IPAddress": "",
ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker exec -it example1_app_1 /bin/bash
root@4e70245934fb:/#
root@4e70245934fb:/#
root@4e70245934fb:/# curl localhost:80
<!DOCTYPE html>
<html>
<head>
<title>Website 1</title>
</head>
<body>
<h1>Hello! This is the first sample website.</h1>
</body>
</html>
root@4e70245934fb:/#
root@4e70245934fb:/#
root@4e70245934fb:/# exit
exit
ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$
ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker exec -it example2_app_1 /bin/bash
root@665b8a873776:/#
root@665b8a873776:/# curl localhost:80
<!DOCTYPE html>
<html>
<head>
<title>Website 2</title>
</head>
<body>
<h1>Hello! This is the second sample website.</h1>
</body>
</html>

root@665b8a873776:/# exit
exit

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker exec -it proxy_proxy_1 /bin/bash

Error response from daemon: Container d9e6fb805551154b2eb3d6eb411cb81495698c1c759ee31d29d1031910798b05 is not running

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$ docker-compose ps
    Name                   Command               State    Ports
---------------------------------------------------------------
proxy_proxy_1   /docker-entrypoint.sh ngin ...   Exit 1

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$

ubuntuserver@ubuntu:~/Nginx-Reverse-Proxy/proxy$

ubuntuserver@ubuntu:~

Could you please help me to resolve this issue ! ! ! !

Hi

What does “docker logs proxy_proxy_1” provide