diff --git a/dockercontainer/DockerFile-mangosd b/dockercontainer/DockerFile-mangosd new file mode 100644 index 00000000..846dd5d3 --- /dev/null +++ b/dockercontainer/DockerFile-mangosd @@ -0,0 +1,28 @@ +#Build image +FROM ubuntu:18.04 as build-step + +RUN apt-get -y update +RUN apt-get -y install curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool build-essential + +COPY . /mangoserver +RUN mkdir /mangoserver/build +WORKDIR /mangoserver/build + +#Install mangos +RUN cmake .. -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=1 -DBUILD_REALMD=0 -DBUILD_TOOLS=0 +RUN make -j4 +RUN make install + +#Runtime image +FROM ubuntu:18.04 as runtime + +RUN apt-get -y update && apt-get -y upgrade +RUN apt-get -y install libmysqlclient20 openssl + +COPY --from=build-step /mangos /mangos +WORKDIR /mangos/bin +RUN cp ../etc/mangosd.conf.dist ../etc/mangosd.conf +RUN chmod +x mangosd + +EXPOSE 8085 +ENTRYPOINT [ "./mangosd" ] diff --git a/dockercontainer/DockerFile-realmd b/dockercontainer/DockerFile-realmd new file mode 100644 index 00000000..7bfbad12 --- /dev/null +++ b/dockercontainer/DockerFile-realmd @@ -0,0 +1,28 @@ +#Build image +FROM ubuntu:18.04 as build-step + +RUN apt-get -y update +RUN apt-get -y install curl autoconf automake cmake libbz2-dev libace-dev libssl-dev libmysqlclient-dev libtool build-essential + +COPY . /mangoserver +RUN mkdir /mangoserver/build +WORKDIR /mangoserver/build + +#Install mangos +RUN cmake .. -DCMAKE_INSTALL_PREFIX=/mangos -DBUILD_MANGOSD=0 -DBUILD_REALMD=1 -DBUILD_TOOLS=0 +RUN make -j4 +RUN make install + +#Runtime image +FROM ubuntu:18.04 as runtime + +RUN apt-get -y update && apt-get -y upgrade +RUN apt-get -y install libmysqlclient20 openssl + +COPY --from=build-step /mangos /mangos +WORKDIR /mangos/bin +RUN cp ../etc/realmd.conf.dist ../etc/realmd.conf +RUN chmod +x realmd + +EXPOSE 3724 +ENTRYPOINT [ "./realmd" ] diff --git a/dockercontainer/Readme.txt b/dockercontainer/Readme.txt new file mode 100644 index 00000000..7af363ad --- /dev/null +++ b/dockercontainer/Readme.txt @@ -0,0 +1,20 @@ +How to start: +To start the docker container use the command "docker-compose up" inside the dockercontainer folder +If you need to rebuild the images use "docker-compose build" + +Now to setup the server make sure you have the correct configuration and the data folder in the correct location: +The configuration should be place here "../../etc" from the dockercontainer folder +The data folder should be place here "../../data" from the dockercontainer folder +Note: those paths can be change inside the docker-compose.yml file + +Configutation: +Inside your "mangosd.conf" make sure the "DataDir" is set to "/mangos/data" +Make sure all the mysql hostname is set to "mysqldb" +The Mysql connection seting is set inside the docker-compose.yml file and can be change +Here the default values: +- MYSQL_USER=mangos +- MYSQL_PASSWORD=mangos +- MYSQL_ROOT_PASSWORD=mangos +- MYSQL_ROOT_HOST=% + +The database need to be run manualy in order to have it initialize \ No newline at end of file diff --git a/dockercontainer/docker-compose.yml b/dockercontainer/docker-compose.yml new file mode 100644 index 00000000..7ccab635 --- /dev/null +++ b/dockercontainer/docker-compose.yml @@ -0,0 +1,48 @@ +#To start the server from this docker-compose file you can run the command "docker-compose up" +#Configure the location of the configuration file and the data folder +#The connection to mysql should match the name of the service in this case "mysqldb" +version: "2.4" +services: + mangosd: + build: + context: .. + dockerfile: dockercontainer/Dockerfile-mangosd + depends_on: + - mysqldb + restart: always + ports: + - "8085:8085" + stdin_open: true + tty: true + volumes: +# - ./local/path/to/etc:/mangos/etc +# - ./local/path/to/data:/mangos/data + - ../../etc:/mangos/etc + - ../../data:/mangos/data + + realmd: + build: + context: .. + dockerfile: dockercontainer/Dockerfile-realmd + depends_on: + - mysqldb + restart: always + ports: + - "3724:3724" + volumes: +# - ./local/path/to/etc:/mangos/etc + - ../../etc:/mangos/etc + + mysqldb: + image: mysql:5.6 + restart: always + environment: + - MYSQL_USER=mangos + - MYSQL_PASSWORD=mangos + - MYSQL_ROOT_PASSWORD=mangos + - MYSQL_ROOT_HOST=% + ports: + - "3306:3306" + volumes: +# - ./local/path/to/mysqldatabase:/var/lib/mysql + - ../../dbdata:/var/lib/mysql