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

Docker + Web UI

Open lelbo opened this issue 10 years ago • 38 comments

Hi

I don t understand end of guides for Docker-run.

I have install and run multi bot with docker image.

Bot work.

Now i want run web-api-google but how configure mulit-bot-docker

I have no information in this/sites

tank you

My cmd for run bot

docker build -t pokemongo-bot .

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

docker run --name=pokego-bot2 --rm -it -v $(pwd)/configs/config-Google.json:/usr/src/app/config.json pokemongo-bot

lelbo avatar Aug 02 '16 11:08 lelbo

This is chinesse for me i m french and no dev-

Share web folder with host:

docker run -it -v $(pwd)/web/:/usr/src/app/web --rm --name=pgo-bot-acct1 pokemongo-bot --config config.json TODO: Add configuration for running multiple Docker containers from the same image for every bot instance, and a single container for the web UI.

lelbo avatar Aug 02 '16 11:08 lelbo

Salut, French DevOps here :) If you're not familiar with docker, it's actually not docker way to run multiple apps inside one container. Sharing the web folder with volume is the best way to share file between containers.

So you're going to need one container by bot and another for webUI. Try to see Docker Compose, it's maybe an alternative to your issue.

Actually what you need is:

$ docker run -d --name=pkm-bot1 -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web:/usr/src/app/web pokemon-bot -cf configs/config1.json

$ docker run -d --name=pkm-bot2 -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web:/usr/src/app/web pokemon-bot -cf configs/config2.json

$ docker run -d -v $(pwd)/web:/usr/share/nginx/html -p 8080:80 nginx

Lunik avatar Aug 02 '16 11:08 Lunik

Tank you

but dont have nginx in my mac-os but no possible to run with ## python -m SimpleHTTPServer

tank you

lelbo avatar Aug 02 '16 11:08 lelbo

and config1 and config2 is a userdata.js in /bot/web/ folder ?

lelbo avatar Aug 02 '16 11:08 lelbo

Hum... Docker is really powerfull because you don't need to install anything. So you don't need to install nginx to run nginx container.

The config1 and config2 are your pokecli configs that are stored inside configs/. The userdate.js should be inside your $(pwd)/web.

Lunik avatar Aug 02 '16 12:08 Lunik

Je suis confus et perdu avec vos linges de codes, j obtiens docker: Error parsing reference: "/Users/mica/Documents/Bot/PokemonGo-Bot/web:/usr/local/var/www/html" is not a valid repository/tag.

lelbo avatar Aug 02 '16 12:08 lelbo

My bad ! I've forgot the -v option...

$ docker run -d -v $(pwd)/web:/usr/share/nginx/html -p 8080:80 nginx

Lunik avatar Aug 02 '16 12:08 Lunik

for docker you need to redirect the webserver poort and need to add to start it.

maestroi avatar Aug 02 '16 12:08 maestroi

I m follow guides in wiki.

Lunik I have run cmd but no work :

docker run -d -v $(pwd)/web:/usr/share/nginx/html nginx

011637bffc329629772cca23545de511bbdea2a95b20cb16454a755342240b68

this line is for me in guides i think docker run -it -v $(pwd)/web/:/usr/src/app/web --rm --name=pgo-bot-acct1 pokemongo-bot --config config.json

lelbo avatar Aug 02 '16 12:08 lelbo

for docker you also need to specifi the poort and port to redirect to

maestroi avatar Aug 02 '16 12:08 maestroi

@maestroi You're right ! I have the head in the clouds today xD

@lelbo

$ docker run -d -v $(pwd)/web:/usr/share/nginx/html -p 8080:80 nginx
$ go to http://localhost:8080

Lunik avatar Aug 02 '16 12:08 Lunik

OK, i have a map now but no marker i m go view here is problem

tank you

lelbo avatar Aug 02 '16 13:08 lelbo

check the maps logs with

$ docker logs <container-id>

Lunik avatar Aug 02 '16 13:08 Lunik

http://pastebin.com/xSd9jQ2j

lelbo avatar Aug 02 '16 13:08 lelbo

Hum, did you specify an user into web/userdata.js ?

Lunik avatar Aug 02 '16 13:08 Lunik

// MUST CONFIGURE THE USER ARRAY AND GOOGLE MAPS API KEY. // YOU CAN GET A KEY HERE: https://developers.google.com/maps/documentation/javascript/get-api-key var userInfo = { users: ["[email protected]"], userZoom: true, zoom: 16, userFollow: true, gMapsAPIKey: "XXXXXXX" };

lelbo avatar Aug 02 '16 14:08 lelbo

Hide your google api please.

and it seems correct...

Lunik avatar Aug 02 '16 14:08 Lunik

Hello there, I kinda have the same issue, but I'm on debian and I already have nginx running, but not with docker. So i tried to do: $ docker run -d --name=pkm-bot1 -p 8000:8000 -v $(pwd)/configs:/usr/src/app/configs -v $(pwd)/web:/usr/src/app/web pokemon-bot -cf configs/config1.json and then I declared my location under my nginx conf as usual, but it doesn't work... Any idea ? Thanks a lot!

lokiiiii avatar Aug 02 '16 18:08 lokiiiii

@lokiiiii for the bot container, the port is useless (-p 8000:8000). In your nginx config you must specify the root to /home/lokiiiii/pkmbot/web

Lunik avatar Aug 03 '16 06:08 Lunik

OK, I changed my approach: I rebuild my images using docker-compose and now I have two containers : 1 for the bot, and 1 for the web. (the web's one has a -p 8000:8000) I can now access to http://my_IP:web_port, but I can only see a listing directory with my userdata.js and 3 xxx-my_gmail_account.json files. Am I doing it wrong ?

lokiiiii avatar Aug 03 '16 09:08 lokiiiii