PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

Docker no map for web

Open supercourgette opened this issue 10 years ago • 3 comments

Hi, I have an issue with Docker under Windows. I cannot access the web map.

Expected Behavior

When browsing http://192.168.99.100:8000/, seeing the pokemonGo-BOT directory, in order to access the web directory.

Actual Behavior

When browsing http://192.168.99.100:8000/, I access a directory with only a few files: capture

Your FULL config.json (remove your username, password, gmapkey and any other private info)

Not relevant here. Instead here is my docker ps:

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
dfbac7152492        python:2.7          "python -m SimpleHTTP"   4 minutes ago       Up 4 minutes        0.0.0.0:8000->8000/tcp   bot1-pokegoweb
3f96c3b7975c        pokemongo_bot       "python pokecli.py"      About an hour ago   Up About an hour                             bot1-pokego

We can see there is a port forwarding from bot1-pokemonweb container to the port 8000.

Output when issue occurred

$ docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/
src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
192.168.99.1 - - [16/Aug/2016 13:47:15] "GET / HTTP/1.1" 200 -
192.168.99.1 - - [16/Aug/2016 13:51:44] "GET / HTTP/1.1" 200 -
192.168.99.1 - - [16/Aug/2016 13:51:45] "GET / HTTP/1.1" 200 -
192.168.99.1 - - [16/Aug/2016 13:51:46] "GET /catchable-metapatate.json HTTP/1.1" 200 -

The GET request are fired when I click one of the files or refresh the page.

Steps to Reproduce

Follow the installation of Docker under Windows as describe in the documentation. The problem occurs after entering the following command:

docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer

Other Information

OS: Windows 10 64b Branch: dev Git Commit:

$ git log -n 1 --pretty=format:"%H"
7d0da5a2a400e3dc9f7696d9886de039d7b890ab

Python Version:

$ python -V
Python 2.7.12

Any other relevant files/configs (eg: path files)

Just in case, I tried to access http://localhost:8000/, but there was nothing there. The host information of the container were retrieved using the following command:

$ docker-machine ip default
192.168.99.100

Thanks in advance for your help :)

supercourgette avatar Aug 16 '16 14:08 supercourgette

must add ip on google map api

thementos avatar Aug 16 '16 16:08 thementos

What do you mean?

supercourgette avatar Aug 16 '16 21:08 supercourgette

Ok I got it. The bot container must mount the web directory in order for the map container to use it.

Here is the full command:

Container 1 (bot) docker run --name=bot1-pokego --rm -it -v $(pwd)/configs/config.json:/usr/src/app/configs/config.json -v $(pwd)/web/:/usr/src/app/web/ pokemongo_bot

Container 2 (map) docker run --name=bot1-pokegoweb --rm -it --volumes-from bot1-pokego -p 8000:8000 -v $(pwd)/configs/userdata.js:/usr/src/app/web/userdata.js -w /usr/src/app/web python:2.7 python -m SimpleHTTPServer

Then you can access the map at the host address (http://192.168.99.100:8000/ in my case).

I think the wiki should be updated with those information.

supercourgette avatar Aug 16 '16 21:08 supercourgette