mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
Docker: fix connectivity issues on Mac & Windows (#1275)
This commit is contained in:
@@ -14,13 +14,15 @@ To install AzerothCore using Docker, you have to follow these steps (**respectin
|
|||||||
|
|
||||||
1) Install [Docker](https://docs.docker.com/install/).
|
1) Install [Docker](https://docs.docker.com/install/).
|
||||||
|
|
||||||
2) Launch one instance of the [AzerothCore Dockerized Database](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/database)
|
2) Create a Docker Network: `docker network create ac-network`. All your docker containers will use it to communicate to each other.
|
||||||
|
|
||||||
3) Create an image of the [AzerothCore Dockerized Build](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build)
|
3) Launch one instance of the [AzerothCore Dockerized Database](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/database)
|
||||||
|
|
||||||
4) Launch one instance of the [AzerothCore Dockerized Authserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/authserver)
|
4) Create an image of the [AzerothCore Dockerized Build](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build)
|
||||||
|
|
||||||
5) Launch one instance of the [AzerothCore Dockerized Worldserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/worldserver)
|
5) Launch one instance of the [AzerothCore Dockerized Authserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/authserver)
|
||||||
|
|
||||||
|
6) Launch one instance of the [AzerothCore Dockerized Worldserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/worldserver)
|
||||||
|
|
||||||
|
|
||||||
### Memory usage
|
### Memory usage
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ This provides a way to launch a container with the AzerothCore authserver runnin
|
|||||||
|
|
||||||
- You need to first build the [AzerothCore Build Image](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build).
|
- You need to first build the [AzerothCore Build Image](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build).
|
||||||
|
|
||||||
|
- If you haven't created a docker network yet, create it by simply using `docker network create ac-network`.
|
||||||
|
|
||||||
- You have to copy the file `docker/authserver/etc/authserver.conf.dockerdist` and rename the copied file to `docker/authserver/etc/authserver.conf`. Then open it and change the values where needed (you may need to change the DB port).
|
- You have to copy the file `docker/authserver/etc/authserver.conf.dockerdist` and rename the copied file to `docker/authserver/etc/authserver.conf`. Then open it and change the values where needed (you may need to change the DB port).
|
||||||
|
|
||||||
## Building the container image
|
## Building the container image
|
||||||
@@ -21,10 +23,11 @@ To build the container image you have to be in the **main** folder of your local
|
|||||||
## Run the container
|
## Run the container
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --name azt-authserver \
|
docker run --name ac-auth-container \
|
||||||
--mount type=bind,source="$(pwd)"/docker/authserver/etc/,target=/azeroth-server/etc \
|
--mount type=bind,source="$(pwd)"/docker/authserver/etc/,target=/azeroth-server/etc \
|
||||||
--mount type=bind,source="$(pwd)"/docker/authserver/logs/,target=/azeroth-server/logs \
|
--mount type=bind,source="$(pwd)"/docker/authserver/logs/,target=/azeroth-server/logs \
|
||||||
--network host \
|
-p 127.0.0.1:3724:3724 \
|
||||||
|
--network ac-network \
|
||||||
-it azerothcore/authserver
|
-it azerothcore/authserver
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,16 @@
|
|||||||
[authserver]
|
[authserver]
|
||||||
|
|
||||||
# Do not change this
|
# Do not change this
|
||||||
LogsDir = "/azeroth-server/logs"
|
LogsDir = "/azeroth-server/logs" # will reflect on your host directory: docker/worldserver/logs
|
||||||
|
|
||||||
# Change this configuration accordingly with your setup
|
# Change this configuration accordingly with your docker setup
|
||||||
LoginDatabaseInfo = "127.0.0.1;3600;root;password;acore_auth"
|
# The format is "hostname;port;username;password;database":
|
||||||
|
# - docker containers must be on the same docker network to be able to communicate
|
||||||
|
# - the DB hostname will be the name of the database docker container
|
||||||
|
LoginDatabaseInfo = "ac-db-container;3306;root;password;acore_auth"
|
||||||
|
|
||||||
# Add more configuration overwrites
|
# Add more configuration overwrites by copying settings from from authserver.conf.dist
|
||||||
LogLevel = 3
|
LogLevel = 3
|
||||||
|
SQLDriverLogFile = "SQLDriver.log"
|
||||||
|
SQLDriverQueryLogging = 1
|
||||||
|
|
||||||
|
|||||||
@@ -39,20 +39,27 @@ You can build the image using:
|
|||||||
|
|
||||||
Run the following command to launch a container:
|
Run the following command to launch a container:
|
||||||
|
|
||||||
`docker run --name azt-db -p 127.0.0.1:3306:3306 -e MYSQL_ROOT_PASSWORD=password azerothcore/database`
|
```docker run --name ac-db-container \
|
||||||
|
-p 127.0.0.1:3306:3306 \
|
||||||
|
-e MYSQL_ROOT_PASSWORD=password \
|
||||||
|
--network ac-network \
|
||||||
|
azerothcore/database
|
||||||
|
```
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
`--name` is followed by a container name like `azt-db`. Put whatever name you like, each container should have an unique name.
|
`--name` is followed by a container name like `ac-db-container`. Put whatever name you like, each container should have an unique name.
|
||||||
|
|
||||||
`-p` (port) is followed by `IP_ADDRESS:EXTERNAL_PORT:INTERNAL_PORT`.
|
`-p` (port) is followed by `IP_ADDRESS:EXTERNAL_PORT:INTERNAL_PORT`.
|
||||||
|
|
||||||
- INTERNAL_PORT **must** always be 3306.
|
- INTERNAL_PORT **must** always be 3306.
|
||||||
- EXTERNAL_PORT is the port that you will use to access the mysql-server that is running in your container
|
- EXTERNAL_PORT is the port that you will use to access the mysql-server from outside docker
|
||||||
|
|
||||||
|
`--network` takes the name of the internal docker network. Containers must be on the same network to communicate to each other.
|
||||||
|
|
||||||
**NOTE**: You may want to use an external port different than 3306 in case you have already mysql-server installed in your system (or some other service that is using that port). So you can use for example port 9000 with `-p 127.0.0.1:9000:3306`
|
**NOTE**: You may want to use an external port different than 3306 in case you have already mysql-server installed in your system (or some other service that is using that port). So you can use for example port 9000 with `-p 127.0.0.1:9000:3306`
|
||||||
|
|
||||||
`docker run --name azt-db -p 9000:3306 -e MYSQL_ROOT_PASSWORD=password azerothcore/database`
|
`docker run --name ac-db-container -p 9000:3306 -e MYSQL_ROOT_PASSWORD=password azerothcore/database`
|
||||||
|
|
||||||
`-e MYSQL_ROOT_PASSWORD=password` lets you change the default password for the `root` user.
|
`-e MYSQL_ROOT_PASSWORD=password` lets you change the default password for the `root` user.
|
||||||
|
|
||||||
@@ -74,9 +81,9 @@ You can easily run more instances. You just have to specify a different **name**
|
|||||||
|
|
||||||
Example: I want to launch three instances of the AzerothCore databases, each one listening respectively on port 9001, 9002 and 9003. I can do it with the following commands:
|
Example: I want to launch three instances of the AzerothCore databases, each one listening respectively on port 9001, 9002 and 9003. I can do it with the following commands:
|
||||||
|
|
||||||
`docker run --name azt-db-1 -p 127.0.0.1:9001:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
`docker run --name ac-db-container-1 -p 127.0.0.1:9001:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
||||||
`docker run --name azt-db-2 -p 127.0.0.1:9002:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
`docker run --name ac-db-container-2 -p 127.0.0.1:9002:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
||||||
`docker run --name azt-db-3 -p 127.0.0.1:9003:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
`docker run --name ac-db-container-3 -p 127.0.0.1:9003:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
|
||||||
|
|
||||||
You can use the `docker ps` command to check your running containers.
|
You can use the `docker ps` command to check your running containers.
|
||||||
|
|
||||||
@@ -84,6 +91,6 @@ You can use the `docker ps` command to check your running containers.
|
|||||||
|
|
||||||
## Stopping / removing
|
## Stopping / removing
|
||||||
|
|
||||||
You can stop a container using `docker stop name-of-the container`, for example `docker stop azt-db-1`.
|
You can stop a container using `docker stop name-of-the container`, for example `docker stop ac-db-container-1`.
|
||||||
|
|
||||||
You can then remove the container using `docker rm name-of-the container`, for example `docker rm azt-db-1`.
|
You can then remove the container using `docker rm name-of-the container`, for example `docker rm ac-db-container-1`.
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ This provides a way to launch a container with the AzerothCore authserver runnin
|
|||||||
|
|
||||||
- You need to first build the [AzerothCore Build Image](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build).
|
- You need to first build the [AzerothCore Build Image](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/build).
|
||||||
|
|
||||||
|
- If you haven't created a docker network yet, create it by simply using `docker network create ac-network`.
|
||||||
|
|
||||||
- You have to copy the file `docker/worldserver/worldserver.conf.dockerdist` and rename the copied file to `docker/worldserver/worldserver.conf`. Then open it and change the values where needed (you may need to change the DB port).
|
- You have to copy the file `docker/worldserver/worldserver.conf.dockerdist` and rename the copied file to `docker/worldserver/worldserver.conf`. Then open it and change the values where needed (you may need to change the DB port).
|
||||||
|
|
||||||
- You need to have the **data files** somewhere in your system. If you don't have them yet, check the step ["Download the data files" from the installation guide](https://github.com/AzerothCore/azerothcore-wotlk/wiki/Installation#5-download-the-data-files).
|
- You need to have the **data files** somewhere in your system. If you don't have them yet, check the step ["Download the data files" from the installation guide](https://github.com/AzerothCore/azerothcore-wotlk/wiki/Installation#5-download-the-data-files).
|
||||||
@@ -25,11 +27,12 @@ To build the container image you have to be in the **main** folder of your local
|
|||||||
Replace `/path/to/your/data` with the path of where your data folder is.
|
Replace `/path/to/your/data` with the path of where your data folder is.
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --name azt-worldserver \
|
docker run --name ac-world-container \
|
||||||
--mount type=bind,source=/mnt/70DD9E0635B3A813/azeroth-server/data,target=/azeroth-server/data \
|
--mount type=bind,source=/path/to/your/data,target=/azeroth-server/data \
|
||||||
--mount type=bind,source="$(pwd)"/docker/worldserver/etc/,target=/azeroth-server/etc \
|
--mount type=bind,source="$(pwd)"/docker/worldserver/etc/,target=/azeroth-server/etc \
|
||||||
--mount type=bind,source="$(pwd)"/docker/worldserver/logs/,target=/azeroth-server/logs \
|
--mount type=bind,source="$(pwd)"/docker/worldserver/logs/,target=/azeroth-server/logs \
|
||||||
--network host \
|
-p 127.0.0.1:8085:8085 \
|
||||||
|
--network ac-network \
|
||||||
-it azerothcore/worldserver
|
-it azerothcore/worldserver
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,17 @@
|
|||||||
################################################
|
################################################
|
||||||
[worldserver]
|
[worldserver]
|
||||||
|
|
||||||
# Do not change those
|
# Do NOT change those Dir configs
|
||||||
LogsDir = "/azeroth-server/logs"
|
LogsDir = "/azeroth-server/logs" # will reflect on your host directory: docker/worldserver/logs
|
||||||
DataDir = "/azeroth-server/data"
|
DataDir = "/azeroth-server/data"
|
||||||
|
|
||||||
# Change those configuration accordingly with your setup
|
# Change this configuration accordingly with your docker setup
|
||||||
LoginDatabaseInfo = "127.0.0.1;3600;root;password;acore_auth"
|
# The format is "hostname;port;username;password;database":
|
||||||
WorldDatabaseInfo = "127.0.0.1;3600;root;password;acore_world"
|
# - docker containers must be on the same docker network to be able to communicate
|
||||||
CharacterDatabaseInfo = "127.0.0.1;3600;root;password;acore_characters"
|
# - the DB hostname will be the name of the database docker container
|
||||||
|
LoginDatabaseInfo = "ac-db-container;3306;root;password;acore_auth"
|
||||||
|
WorldDatabaseInfo = "ac-db-container;3306;root;password;acore_world"
|
||||||
|
CharacterDatabaseInfo = "ac-db-container;3306;root;password;acore_characters"
|
||||||
|
|
||||||
# Add more configuration overwrites
|
# Add more configuration overwrites by copying settings from worldserver.conf.dist
|
||||||
LogLevel = 2
|
LogLevel = 2
|
||||||
|
|||||||
Reference in New Issue
Block a user