freyta / 7Eleven-Python

A python script to check fuel prices and also lock them in
GNU General Public License v3.0
128 stars 63 forks source link

Running concurrent containers : Cant access webpage #50

Closed PrawnMan closed 4 years ago

PrawnMan commented 4 years ago

Aim : Run Concurrent Containers to allow multiple LAN users to use my server. Methodology: Previously installed application via docker as per readme. Issued command to run the first server as per instruction:

docker run -d \
  --name 7Eleven_Fuel \
  -p 5000:5000 \
  fuellock

Docker launches application and web interface is available on serverIp:5000 as expected.

Then I try to run a second concurrent instance on a different port:

docker run -d --name 7Eleven_Fuel_2 -p 5001:5001 fuellock

Terminal reports that the program is running.

Expected outcome: Webpage accessible on serverip:5001

Actual outcome: I try to access the web interface on serverip:5001.

The page does not display showing "ERR_CONNECTION_REFUSED"

Output from terminal at this point:


CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS                   PORTS                    NAMES
e14cdfc78636        fuellock              "python app.py"     13 minutes ago      Up 13 minutes            0.0.0.0:5001->5001/tcp   7Eleven_Fuel_2
734d39f3d740        fuellock              "python app.py"     3 weeks ago         Up 8 days                0.0.0.0:5000->5000/tcp   7Eleven_Fuel

.

Host: Linux ionic 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

m1ckyb commented 4 years ago

You have to keep the port of the container the same and change the exposed port

docker run -d --name 7Eleven_Fuel_2 -p 5001:5000 fuellock

As the port is not changed in the container

PrawnMan commented 4 years ago

You have to keep the port of the container the same and change the exposed port

docker run -d --name 7Eleven_Fuel_2 -p 5001:5000 fuellock

As the port is not changed in the container

That's what I was doing incorrectly. Cheers for correcting me. Tried it and it works perfectly now.

EDIT: Sorry, I dont know how to close this or mark it as resolved?

PrawnMan commented 4 years ago

close #50