[GUIDE] Run bot and web interface inside docker container

Antworten
mangunowsky
Beiträge: 1
Registriert: Mi 26. Apr 2023, 12:44
Hat sich bedankt: 1 Mal
Danksagung erhalten: 3 Mal

[GUIDE] Run bot and web interface inside docker container

Beitrag von mangunowsky »

Hello all,

I've created dockerized bot + web interface to use for myself, but I'm happy to share it with you guys. This solution is perfect for people struggling to get bot + web up and running, my script simplifies this process to minimum.

First of all thanks to MFBot team for creating such awesome tool and for Bendas for helping me to sort out how to get web interface running. Bendas original topic - viewtopic.php?t=3087.

Prerequisites

To run docker container you'd obviously need Docker installed on your system.
For this please refer to Docker's documentation. https://docs.docker.com/get-docker/

To clone my repo you need git. https://git-scm.com/book/en/v2/Getting- ... alling-Git

Installation.
Prepare Acc.ini file on MFBot's Windows version. Go to the Settings > Network > Remote Access. Enable remote access - set IP to 127.0.0.1 and choose suitable port number, in my case it's 6969.
  1. Clone repo

    Code: Alles auswählen

    git clone https://github.com/mangunowsky/MFBotDocker.git
  2. Paste Acc.ini file into main repo folder
  3. Build Docker image

    Code: Alles auswählen

    docker build -t mfbot -f Dockerfile .
  4. Run Docker container

    Code: Alles auswählen

    docker run -dit mfbot
  5. Get containers IP address

    Code: Alles auswählen

    docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container ID>
  6. Open web interface in you browser. User and password is "admin" by default.

    Code: Alles auswählen

    http://<container IP>:8050
  7. Happy boting!
Changing web interface listening port.

To change port on which web interface is listeing you need to edit globalVariables.py file located in Web/Functions/

Code: Alles auswählen

ADRESS = 'http://127.0.0.1:6969/' - change port to one set in Remote Access settings

Code: Alles auswählen

serverPort = 8050 - Web interface will be available at this port


I hope you'd find this guide useful. I'm happy to help in case of any questions. ;)
Folgende Benutzer bedankten sich beim Autor mangunowsky für den Beitrag (Insgesamt 3):
neuhier (Do 27. Apr 2023, 00:40) • Allmighty (So 7. Mai 2023, 00:13) • Bendas (Do 18. Mai 2023, 21:10)
Bendas
Beiträge: 7
Registriert: Mo 5. Jul 2021, 10:51
Wohnort: Olomouc
Hat sich bedankt: 3 Mal
Danksagung erhalten: 4 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von Bendas »

Hi!

I'm sorry for my dumb question...

I was trying to set everything like you said, but i can't access the web interface.

Bild

So i feel like it's running but i don't know how to find it... Tried port 8050, 8449, ... but the browser says ERR_CONNECTION_TIMED_OUT. Could you please help?
neuhier
Beiträge: 123
Registriert: Sa 7. Nov 2020, 21:40
Hat sich bedankt: 25 Mal
Danksagung erhalten: 25 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von neuhier »

Did you open the ports tcp connections?
Hello there
Bendas
Beiträge: 7
Registriert: Mo 5. Jul 2021, 10:51
Wohnort: Olomouc
Hat sich bedankt: 3 Mal
Danksagung erhalten: 4 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von Bendas »

neuhier hat geschrieben: Do 18. Mai 2023, 22:20 Did you open the ports tcp connections?
You mean TCP ports 8449, 8050? Did i something wrong?

https://prnt.sc/qjkty1lQD7QE

I mean like why is there no port?

https://prnt.sc/rWvv6NytiZei

EDIT: I forgot that it's port 8443 not 8449 but it's still the same.
neuhier
Beiträge: 123
Registriert: Sa 7. Nov 2020, 21:40
Hat sich bedankt: 25 Mal
Danksagung erhalten: 25 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von neuhier »

whats the firewall software u use on ur linux machine ?

find that out and allow tcp connection for the ports
Hello there
Bendas
Beiträge: 7
Registriert: Mo 5. Jul 2021, 10:51
Wohnort: Olomouc
Hat sich bedankt: 3 Mal
Danksagung erhalten: 4 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von Bendas »

Well i don't think there is firewall...

Code: Alles auswählen

bendas@server:~$ sudo ufw status verbose
Status: inactive
I'm using the Linux Server Ubuntu 22.04.2 LTS
neuhier
Beiträge: 123
Registriert: Sa 7. Nov 2020, 21:40
Hat sich bedankt: 25 Mal
Danksagung erhalten: 25 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von neuhier »

hm well then out of luck, that was my issue. gotta wait for the guide owner then.
Folgende Benutzer bedankten sich beim Autor neuhier für den Beitrag:
Bendas (Fr 19. Mai 2023, 19:43)
Hello there
Bendas
Beiträge: 7
Registriert: Mo 5. Jul 2021, 10:51
Wohnort: Olomouc
Hat sich bedankt: 3 Mal
Danksagung erhalten: 4 Mal

Re: [GUIDE] Run bot and web interface inside docker container

Beitrag von Bendas »

So Yeah i managed to make it work. Thanks to GitHub https://github.com/mangunowsky/MFBotDocker

The problem was:

"To get the webinterface working I had to map the port to my local ip via:

Code: Alles auswählen

docker run -p ip_adress:8050:8050 -dit mfbot
Now everything works really well! Thank you all!
Antworten

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 23 Gäste