DarkflameServer/docker/Dockerfile

71 lines
2.4 KiB
Docker
Raw Normal View History

2021-12-07 15:29:26 +00:00
FROM debian:11-slim as build
2021-12-07 13:50:05 +00:00
WORKDIR /build
RUN --mount=type=cache,target=/var/cache/apt \
echo "Install build dependencies" && \
apt update && \
apt remove -y libmysqlcppconn7v5 libmysqlcppconn-dev && \
apt install cmake zlib1g-dev make gcc g++ build-essential unzip ca-certificates wget -yqq --no-install-recommends && \
2021-12-07 15:29:26 +00:00
rm -rf /var/lib/apt/lists/* && \
update-ca-certificates && \
wget https://dev.mysql.com/get/Downloads/Connector-C++/libmysqlcppconn9_8.0.27-1debian11_amd64.deb -O /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb && \
dpkg -i /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb && \
rm -rf /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb
2021-12-07 13:50:05 +00:00
COPY dAuthServer/ /build/dAuthServer
COPY dChatServer/ /build/dChatServer
COPY dCommon/ /build/dCommon
COPY dChatFilter/ /build/dChatFilter
COPY dDatabase/ /build/dDatabase
COPY dGame/ /build/dGame
COPY dMasterServer/ /build/dMasterServer
COPY dNet/ /build/dNet
COPY dPhysics/ /build/dPhysics
COPY dScripts/ /build/dScripts
COPY dWorldServer/ /build/dWorldServer
COPY dZoneManager/ /build/dZoneManager
COPY migrations/ /build/migrations
COPY resources/ /build/resources
COPY thirdparty/ /build/thirdparty
COPY vanity /build/vanity
COPY .clang-* CMake* LICENSE /build/
ARG BUILD_THREADS=1
2021-12-07 15:29:26 +00:00
ARG BUILD_VERSION=171022
2021-12-07 13:50:05 +00:00
RUN echo "Build server" && \
mkdir -p build && \
cd build && \
sed -i -e "s/171022/${BUILD_VERSION}/g" ../CMakeVariables.txt && \
2021-12-07 15:29:26 +00:00
cmake .. && \
make -j $BUILD_THREADS
RUN mkdir -p /build/build/res/maps/navmeshes/ && \
unzip /build/resources/navmeshes.zip -d /build/build/res/maps
FROM debian:11-slim as runtime
2021-12-07 13:50:05 +00:00
WORKDIR /app
2021-12-07 15:29:26 +00:00
COPY --from=build /build/build /app
COPY --from=build /build/migrations /app/migrations
RUN --mount=type=cache,target=/var/cache/apt \
apt update && \
apt install mariadb-client python3 sqlite3 ca-certificates wget -yqq --no-install-recommends && \
apt remove -y libmysqlcppconn7v5 libmysqlcppconn-dev && \
2021-12-07 15:29:26 +00:00
rm -rf /var/lib/apt/lists/* && \
update-ca-certificates && \
wget https://dev.mysql.com/get/Downloads/Connector-C++/libmysqlcppconn9_8.0.27-1debian11_amd64.deb -O /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb && \
dpkg -i /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb && \
rm -rf /tmp/libmysqlcppconn9_8.0.27-1debian11_amd64.deb
2021-12-07 15:29:26 +00:00
2021-12-07 13:50:05 +00:00
ADD docker/*.py /app/utils/
COPY docker/start_server.sh /start_server.sh
RUN chmod +x /start_server.sh
CMD [ "/start_server.sh" ]