This repository lists everything needed to build and run Docker images for Mangos project.
Each folder is dedicated to a specific version of Mangos, inside you will find everything about this precise version (from Dockerfile to deployment files). Each version currently provides 3 Docker images :
- mangosd: this the world server that needs maps to work. This is the server the players will be playing on.
- realmd: this is the login server. This is the server the players will log into.
- mysql-database: this is the database used both by the world server and the login server.
Each image is self-sufficient, you can build it simply going into the folder of the version you wish to build and using:
docker build -t mytag:myversion .
Note: I personnaly have automatic CI/CD to build and push up-to-date Docker images to the Docker Hub.
Several ways are available to launch your own server and are listed below.
This is OK if you want to create a little server with not much players. Also, this is a way to check that your configuration is OK.
docker run -i -v /path/to/maps:/etc/mangos/maps -v /path/to/vmaps:/etc/mangos/vmaps -v /path/to/mmaps:/etc/mangos/mmaps -v /path/to/dbc:/etc/mangos/dbc -e "LOGIN_DATABASE_INFO=localhost;3306;root;mangos;realmd" -e "WORLD_DATABASE_INFO=localhost;3306;root;mangos;mangos" -e "CHARACTER_DATABASE_INFO=localhost;3306;root;mangos;characters" -p 8085:8085 -d ssorriaux/<version>-server:latest
It is possible to configure AH using the ahbot.conf
file. Add this parameter to the world server launch command:
-v /path/to/ahbot.conf:/mangosconf/ahbot.conf
Be aware to use the /mangosconf/ahbot.conf
file and not the one in /etc/mangos/
.
docker run -e MYSQL_ROOT_PASSWORD=mangos -p 3306:3306 -v /path/to/data/:/var/lib/mysql -d ssorriaux/<version>-database-mysql:latest
If /path/to/data
is empty, the database will be initialized running all SQL scripts from the database repository.
Please note the MYSQL_ROOT_PASSWORD
value will be used for root user password.
If you already have datas and want to update your database, you can use the /docker-entrypoint-initdb.d
folder. Those scripts will be played before giving access to the database. This can be done adding the following parameter to the previous command:
-v /path/to/my/sql/scripts/:/docker-entrypoint-initdb.d/
docker run -e "LOGIN_DATABASE_INFO=localhost;3306;root;mangos;realmd" -p 3724:3724 -d ssorriaux/<version>-realmd:latest
You will first need to edit the docker-compose.yml
file to specify the path to your maps.
Then, simply execute:
docker-compose up -d
Currently, you will need to add the maps on the node that will host the world server and change the volume
declaration inside the world server deployment.
In the future, it is possible to make this simpler putting all maps inside somewhere and getting it using an initContainer
or using a PersistentVolume
.
Create the whole server using:
kubectl apply -f kubernetes-deployment.yml
Passwords are kept inside the Secret
resource.
There is a helm chart included in this repository that can be used to provide a more flexible way of deploying to Kubernetes.
To deploy, make any needed edits to the values.yaml
file and apply using:
helm install
You will not find any maps (those resources are Blizzard's properties) in these Docker images, you will need to provide it yourself using several methods listed below.
When creating your world server container, you will need to provide the path, from your host, to:
- maps
- vmaps
- mmaps
- dbc
Before creating the whole server, you will need to provide the path, from your host, to:
- maps
- vmaps
- mmaps
- dbc
This can be done editing the docker-compose.yml
file.
Before creating the whole server, you will need to provide the path, from your host, to:
- maps
- vmaps
- mmaps
- dbc
This can be done editing the kubernetes-deployment.yml
file.
Host paths can be set by editing the values.yaml
file.
- Place your maps in some directory on Windows, for example
c:/mangos_maps/maps
c:/mangos_maps/vmaps
c:/mangos_maps/mmaps
c:/mangos_maps/dbc
- If you're using docker-compose modify volumes section to look like this
volumes:
- c:/mangos_maps/maps:/etc/mangos/maps
- c:/mangos_maps/vmaps:/etc/mangos/vmaps
- c:/mangos_maps/mmaps:/etc/mangos/mmaps
- c:/mangos_maps/dbc:/etc/mangos/dbc
Feel free to create any issue or pull-request.