mangos/contrib/docker/doc/SINGLE.md
andybe c4095615b6
docker contribution for linux (#153)
* initial review for docker

* update link

* more typos

* hight letter

* it's realm.rft

* realm.rtf

* remove legacy code from dockerfiles

* docker-compose cleanup,- documented clone the right database

* add timezone to mangos.env

* add more at the build command

* double only

* it's a script not a container

* more documentation and moved into seperate folder

* revert back the openssl

* reformat documentation

* high letter

* timezone

* reduce dockerfiles and add documentation

* removed mangos user from build script

* correct links for realmd and world

* fixing small things, after railroid the documentation.

* command is called restart

* hold the documentation line

* add the changes for realmlist.wtf

Co-authored-by: AndyBe <andreas.benzler@gmail.com>
2021-05-09 21:11:05 +01:00

4.3 KiB

Example container for the mangos zero

What you need to know:

This example works only on local(host) machine. For the cloud the database must be changed. Not here documented.

We use a build container? Because realm and world should be small as possible and shippes only we the nessery binaries.

1) Create the build container on ubuntu:focal


git clone git clone https://github.com/mangoszero/server.git mangos --recursive 

docker build mangos/contrib/docker/ -t mangos-zero-build

2) Build the source and create directory structur


Create a build script

echo "docker run -v$(pwd)/app:/app -v $(pwd):/work " \
     "--rm -it  --entrypoint ./mangos/contrib/docker/build.sh \
     mangos-zero-build" > build.sh
     
chmod +x build.sh

For a rebuild next time we only need

./build.sh (&& docker-compose build && docker-compose restart)

(Optional) Create an extractor container script for the maps

echo "docker run -v$(pwd)/app:/app -v $(pwd):/work " \
     "--rm -it mangos-zero-build bash" > extract.sh

3) (Optional) Extract needed data from client


Copy the full client into you work directory like (here from linux lutris)

cp -r /home/XXX/Games/WorldOfWarcraft/drive_c/WoW1.12.1 .

Join into the extractor container (build)

./extract.sh
(container) cd WoW1.12.1
(container) cp -r ../app/bin/tools/* .
(container) chmod +x Extractor.sh
(container) ./Extractor.sh
(container) exit

This may take a while.
Now wee need a data directory.

mkdir data
cd WoW1.12.1
cp -r Buildings  dbc  maps  mmaps  vmaps ../data

4) If everything went fine we create our container by


docker-compose build

5) Intialize the database


We need the right database for the server.

git clone https://github.com/mangoszero/database zero-database --recursive

Now we can start the database container.

docker-compose up -d mangos-db
docker exec -it mangos-db bash
(container) cd zero-database
(container) ./InstallDatabases.sh

Database (root for now)
- host: localhost
- user: "root"
- password: "mangos"

(container) exit

6) Configure container


cd app/etc
sudo cp realmd.conf.dist realmd.conf
sudo cp mangosd.conf.dist mangosd.conf
sudo cp ahbot.conf.dist ahbot.conf

For realmd change follow lines in realmd.conf (wee need to root)
-> sudo nano realmd.conf

LoginDatabaseInfo      = "localhost;3306;root;mangos;realmd"
LogsDir                = ""

into

LoginDatabaseInfo      = "mangos-db;3306;root;mangos;realmd"
LogsDir                = "/app/logs"

For mangosd we update mangosd.conf (wee need to root)
-> sudo nano mangosd.conf

DataDir                      = ""
LogsDir                      = ""
LoginDatabaseInfo            = "127.0.0.1;3306;root;mangos;realmd"
WorldDatabaseInfo            = "127.0.0.1;3306;root;mangos;mangos0"
CharacterDatabaseInfo        = "127.0.0.1;3306;root;mangos;character0"

into

DataDir                      = "/app/data"
LogsDir                      = "/app/logs"
LoginDatabaseInfo            = "mangos-db;3306;root;mangos;realmd"
WorldDatabaseInfo            = "mangos-db;3306;root;mangos;mangos0"
CharacterDatabaseInfo        = "mangos-db;3306;root;mangos;character0"

Back to the workspace

cd ../..

7) Start the realmd & mangos-one container detached


docker-compose up -d mangos-realm mangos-one

take a look with "docker stats". Hopefully all container stay and not reloaded all the time.

8) Join the world container to create an admin user


docker exec -it mangos-zero bash
(container) screen -r (go into screen)
(container - screen) account create testuser mypassword
(container - screen) strg + a + d   (detache from screen)
(container) exit

9) Don't forget to change the realmlist.wtf from WoW client to localhost.

set realmlist localhost