mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
Merge pull request #4 from MrSlntGhost/Playerbot
Fix docker load metadata error
This commit is contained in:
@@ -28,70 +28,12 @@ RUN mkdir -pv \
|
|||||||
/azerothcore/src \
|
/azerothcore/src \
|
||||||
/azerothcore/build
|
/azerothcore/build
|
||||||
|
|
||||||
ENV DOCKER=1
|
# Configure Timezone
|
||||||
|
RUN apt-get update \
|
||||||
# Ensure ac-dev-server can properly pull versions
|
&& apt-get install -y tzdata ca-certificates \
|
||||||
ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||||
|
&& echo $TZ > /etc/timezone \
|
||||||
# set timezone environment variable
|
&& dpkg-reconfigure --frontend noninteractive tzdata
|
||||||
ENV TZ=Etc/UTC
|
|
||||||
|
|
||||||
# set noninteractive mode so tzdata doesn't ask to set timezone on install
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# Do not use acore dashboard to install
|
|
||||||
# since it's not cacheable by docker
|
|
||||||
RUN apt-get update && apt-get install -y gdb gdbserver git dos2unix lsb-core sudo curl unzip \
|
|
||||||
make cmake clang libmysqlclient-dev \
|
|
||||||
libboost-system1.7*-dev libboost-filesystem1.7*-dev libboost-program-options1.7*-dev libboost-iostreams1.7*-dev libboost-thread1.7*-dev \
|
|
||||||
build-essential libtool cmake-data openssl libgoogle-perftools-dev google-perftools \
|
|
||||||
libssl-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev mysql-client \
|
|
||||||
libncurses5-dev ccache \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Ensure git will work with the AzerothCore source directory
|
|
||||||
RUN git config --global --add safe.directory /azerothcore
|
|
||||||
|
|
||||||
# change timezone in container
|
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
|
|
||||||
|
|
||||||
# Create a non-root user
|
|
||||||
RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
passwd -d "$DOCKER_USER" && \
|
|
||||||
echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# must be created to set the correct permissions on them
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/Cameras
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/dbc
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/maps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/mmaps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/vmaps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/logs
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/temp
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/etc
|
|
||||||
RUN mkdir -p /azerothcore/var/build/obj
|
|
||||||
|
|
||||||
# Correct permissions for non-root operations
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /home/acore
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /run
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /opt
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /azerothcore
|
|
||||||
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
# copy only necessary files for the acore dashboard
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER apps /azerothcore/apps
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER bin /azerothcore/bin
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER conf /azerothcore/conf
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER data /azerothcore/data
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER deps /azerothcore/deps
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.json /azerothcore/acore.json
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.sh /azerothcore/acore.sh
|
|
||||||
|
|
||||||
# Download deno and make sure the dashboard works
|
|
||||||
RUN bash /azerothcore/acore.sh quit
|
|
||||||
|
|
||||||
WORKDIR /azerothcore
|
WORKDIR /azerothcore
|
||||||
|
|
||||||
@@ -132,193 +74,6 @@ COPY deps /azerothcore/deps
|
|||||||
COPY src /azerothcore/src
|
COPY src /azerothcore/src
|
||||||
COPY modules /azerothcore/modules
|
COPY modules /azerothcore/modules
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# SERVICE BASE: prepare the OS for the production-ready services
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
|
|
||||||
FROM ubuntu:20.04 as servicebase
|
|
||||||
|
|
||||||
ARG USER_ID=1000
|
|
||||||
ARG GROUP_ID=1000
|
|
||||||
ARG DOCKER_USER=acore
|
|
||||||
|
|
||||||
LABEL description="AC service image for server applications"
|
|
||||||
|
|
||||||
# List of timezones: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
||||||
|
|
||||||
# set timezone environment variable
|
|
||||||
ENV TZ=Etc/UTC
|
|
||||||
|
|
||||||
# set noninteractive mode so tzdata doesn't ask to set timezone on install
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# Create a non-root user
|
|
||||||
RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
passwd -d "$DOCKER_USER" && \
|
|
||||||
echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# install the required dependencies to run the server
|
|
||||||
RUN apt-get update && apt-get install -y dos2unix gdb gdbserver google-perftools libgoogle-perftools-dev net-tools \
|
|
||||||
libboost-system1.7*-dev libboost-filesystem1.7*-dev libboost-program-options1.7*-dev libboost-iostreams1.7*-dev libboost-thread1.7*-dev \
|
|
||||||
tzdata libmysqlclient-dev mysql-client curl unzip && rm -rf /var/lib/apt/lists/* ;
|
|
||||||
|
|
||||||
# change timezone in container
|
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
|
|
||||||
|
|
||||||
# Correct permissions for non-root operations
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /home/acore
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /run
|
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /opt
|
|
||||||
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=base /azerothcore /azerothcore
|
|
||||||
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
# must be created to avoid permissions errors
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/Cameras
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/dbc
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/maps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/mmaps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/data/vmaps
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/logs
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/etc
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin
|
|
||||||
|
|
||||||
# Download deno and make sure the dashboard works
|
|
||||||
RUN bash /azerothcore/acore.sh quit
|
|
||||||
|
|
||||||
WORKDIR /azerothcore/
|
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# AUTH & WORLD local: images used for local services
|
|
||||||
# These images don't include binaries by default
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
|
|
||||||
FROM servicebase as authserver-local
|
|
||||||
|
|
||||||
LABEL description="AC authserver image for local environment"
|
|
||||||
|
|
||||||
CMD ./acore.sh run-authserver
|
|
||||||
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
FROM servicebase as worldserver-local
|
|
||||||
|
|
||||||
LABEL description="AC worldserver image for local environment"
|
|
||||||
|
|
||||||
CMD ./acore.sh run-worldserver
|
|
||||||
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# BUILD: compile sources
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
FROM base as build
|
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
LABEL description="AC Image used by the build stage to generate production images"
|
|
||||||
|
|
||||||
RUN mkdir -p /azerothcore/env/etc/
|
|
||||||
|
|
||||||
# .git is needed by the compiler
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER ./.git /azerothcore/.git
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER ./CMakeLists.txt /azerothcore/CMakeLists.txt
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER ./deps /azerothcore/deps
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER ./src /azerothcore/src
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER ./modules /azerothcore/modules
|
|
||||||
# check if we have ccache files available outside
|
|
||||||
RUN rm -rf /azerothcore/var/ccache/*
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER var/docker/ccache /azerothcore/var/ccache
|
|
||||||
|
|
||||||
# install eluna
|
|
||||||
RUN git clone --depth=1 --branch=master https://github.com/azerothcore/mod-eluna.git /azerothcore/modules/mod-eluna
|
|
||||||
|
|
||||||
ENV USER_CONF_PATH=/azerothcore/apps/docker/config-docker.sh
|
|
||||||
ENV CTYPE=RelWithDebInfo
|
|
||||||
ENV AC_CCACHE=true
|
|
||||||
ENV CCACHE_CPP2=true
|
|
||||||
ENV CSCRIPTPCH=OFF
|
|
||||||
ENV CCOREPCH=OFF
|
|
||||||
ENV CTOOLS_BUILD=all
|
|
||||||
# ENV CTOOLS_BUILD=maps-only
|
|
||||||
ENV CSCRIPTS=static
|
|
||||||
RUN bash apps/docker/docker-build-prod.sh
|
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# AUTH SERVICE: create a ready-to-use authserver image
|
|
||||||
# with binaries included
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
FROM authserver-local as authserver
|
|
||||||
|
|
||||||
LABEL description="AC Production: authserver"
|
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/authserver /azerothcore/env/dist/bin/authserver
|
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# WORLD SERVICE: create a ready-to-use worldserver image
|
|
||||||
# with binaries and data included
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
FROM worldserver-local as worldserver
|
|
||||||
|
|
||||||
LABEL description="AC Production: worldserver"
|
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
|
||||||
USER $DOCKER_USER
|
|
||||||
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin/lua_scripts
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/worldserver /azerothcore/env/dist/bin/worldserver
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/lua_scripts /azerothcore/env/dist/bin/lua_scripts
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/dbimport /azerothcore/env/dist/bin/dbimport
|
|
||||||
|
|
||||||
#================================================================
|
|
||||||
#
|
|
||||||
# CLIENT DATA
|
|
||||||
#
|
|
||||||
#=================================================================
|
|
||||||
|
|
||||||
FROM ubuntu:20.04 as client-data
|
|
||||||
ARG USER_ID=1000
|
|
||||||
ARG GROUP_ID=1000
|
|
||||||
ARG DOCKER_USER=acore
|
|
||||||
|
|
||||||
LABEL description="AC Production: client-data"
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y tzdata curl unzip && rm -rf /var/lib/apt/lists/* ;
|
|
||||||
|
|
||||||
# set timezone environment variable
|
|
||||||
ENV TZ=Etc/UTC
|
|
||||||
|
|
||||||
# set noninteractive mode so tzdata doesn't ask to set timezone on install
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
|
|
||||||
passwd -d "$DOCKER_USER" && \
|
|
||||||
echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|
||||||
|
|
||||||
# ENV DATAPATH=/azerothcore/env/dist/data-temp
|
|
||||||
ENV DATAPATH=/azerothcore/env/dist/data
|
|
||||||
ENV DATAPATH_ZIP=/tmp/data.zip
|
|
||||||
|
|
||||||
RUN mkdir -p "$DATAPATH"
|
|
||||||
ARG CACHEBUST=1
|
ARG CACHEBUST=1
|
||||||
|
|
||||||
WORKDIR /azerothcore/build
|
WORKDIR /azerothcore/build
|
||||||
@@ -370,9 +125,7 @@ COPY --from=build /azerothcore/env/dist/etc/ /azerothcore/env/ref/etc
|
|||||||
|
|
||||||
VOLUME /azerothcore/env/dist/etc
|
VOLUME /azerothcore/env/dist/etc
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y libmysqlclient-dev libssl-dev libbz2-dev \
|
ENV PATH="/azerothcore/env/dist/bin:$PATH"
|
||||||
libboost-system1.7*-dev libboost-filesystem1.7*-dev libboost-program-options1.7*-dev libboost-iostreams1.7*-dev libboost-thread1.7*-dev \
|
|
||||||
sudo && rm -rf /var/lib/apt/lists/* ;
|
|
||||||
|
|
||||||
RUN groupadd --gid "$GROUP_ID" "$DOCKER_USER" && \
|
RUN groupadd --gid "$GROUP_ID" "$DOCKER_USER" && \
|
||||||
useradd -d /azerothcore --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
|
useradd -d /azerothcore --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \
|
||||||
@@ -500,4 +253,4 @@ COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build \
|
|||||||
/azerothcore/env/dist/bin/vmap4_assembler /azerothcore/env/dist/bin/vmap4_assembler
|
/azerothcore/env/dist/bin/vmap4_assembler /azerothcore/env/dist/bin/vmap4_assembler
|
||||||
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build \
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build \
|
||||||
/azerothcore/env/dist/bin/vmap4_extractor /azerothcore/env/dist/bin/vmap4_extractor
|
/azerothcore/env/dist/bin/vmap4_extractor /azerothcore/env/dist/bin/vmap4_extractor
|
||||||
@@ -70,6 +70,7 @@ services:
|
|||||||
AC_LOGIN_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth"
|
AC_LOGIN_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth"
|
||||||
AC_WORLD_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_world"
|
AC_WORLD_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_world"
|
||||||
AC_CHARACTER_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_characters"
|
AC_CHARACTER_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_characters"
|
||||||
|
AC_PLAYERBOTS_DATABASE_INFO: "ac-database;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_playerbots"
|
||||||
ports:
|
ports:
|
||||||
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
||||||
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
||||||
|
|||||||
Reference in New Issue
Block a user