Make the Docker installation easy

See: https://github.com/azerothcore/azerothcore-wotlk/wiki/Install-with-Docker
This commit is contained in:
Francesco Borzì
2019-01-16 20:44:02 +01:00
committed by GitHub
parent 7599624fdf
commit b578bce1d1
14 changed files with 131 additions and 27 deletions

View File

@@ -9,6 +9,9 @@ Instances (containers) can be easily set up and then destroyed, so you can alway
**NOTE**: you do **not** need to install any mysql-server manually in your system and if you already have it, the docker instances will **not** interfere with it.
If you just want to install the whole AzerothCore quickly using Docker Compose, we recommend following [this guide instead](https://github.com/azerothcore/azerothcore-wotlk/wiki/install-with-Docker).
# Setup & usage instructions
### Requirements
@@ -28,7 +31,9 @@ and cd into it `cd azerothcore-wotlk`.
You can build the image using:
`docker build -t azerothcore/database -f docker/database/Dockerfile .`
```
docker build -t azerothcore/database -f docker/database/Dockerfile .
```
**Note:** the version of your DB will be the one of your sources when you built the image. If you want to update it, just update your sources (`git pull`) and build the image again.
@@ -39,7 +44,8 @@ You can build the image using:
Run the following command to launch a container:
```docker run --name ac-db-container \
```
docker run --name ac-database \
-p 127.0.0.1:3306:3306 \
-e MYSQL_ROOT_PASSWORD=password \
--network ac-network \
@@ -48,7 +54,7 @@ Run the following command to launch a container:
Where:
`--name` is followed by a container name like `ac-db-container`. Put whatever name you like, each container should have an unique name.
`--name` is followed by a container name like `ac-database`. Put whatever name you like, each container should have an unique name.
`-p` (port) is followed by `IP_ADDRESS:EXTERNAL_PORT:INTERNAL_PORT`.
@@ -59,7 +65,7 @@ Where:
**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 ac-db-container -p 9000:3306 -e MYSQL_ROOT_PASSWORD=password azerothcore/database`
`docker run --name ac-database -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.
@@ -81,9 +87,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:
`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 ac-db-container-2 -p 127.0.0.1:9002: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`
`docker run --name ac-database-1 -p 127.0.0.1:9001:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
`docker run --name ac-database-2 -p 127.0.0.1:9002:3306 -e MYSQL_ROOT_PASSWORD=password -d azerothcore/database`
`docker run --name ac-database-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.
@@ -91,6 +97,6 @@ You can use the `docker ps` command to check your running containers.
## Stopping / removing
You can stop a container using `docker stop name-of-the container`, for example `docker stop ac-db-container-1`.
You can stop a container using `docker stop name-of-the container`, for example `docker stop ac-database-1`.
You can then remove the container using `docker rm name-of-the container`, for example `docker rm ac-db-container-1`.
You can then remove the container using `docker rm name-of-the container`, for example `docker rm ac-database-1`.