2023-12-07 22:12:45 +02:00
|
|
|
FROM ubuntu:latest as build
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Update the system and install various dependencies
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y git cmake build-essential tar curl zip unzip pkg-config autoconf python3 \
|
|
|
|
libdevil-dev libncurses5-dev libbsd-dev
|
|
|
|
|
|
|
|
# Install vcpkg and the required libraries
|
|
|
|
RUN git clone https://github.com/Microsoft/vcpkg.git
|
|
|
|
RUN bash ./vcpkg/bootstrap-vcpkg.sh
|
2023-12-30 10:30:52 +02:00
|
|
|
RUN ./vcpkg/vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo fmt spdlog
|
2023-12-07 22:12:45 +02:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2023-12-10 10:00:55 +02:00
|
|
|
# Build the binaries
|
2023-12-07 22:12:45 +02:00
|
|
|
RUN mkdir build/
|
|
|
|
RUN cd build && cmake -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
|
|
|
RUN cd build && make -j $(nproc)
|
|
|
|
|
|
|
|
FROM ubuntu:latest as app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-12-10 10:00:55 +02:00
|
|
|
RUN apt-get update && apt-get install -y python2 libdevil-dev libbsd-dev && apt-get clean
|
2023-12-07 22:12:45 +02:00
|
|
|
|
|
|
|
# Copy the binaries from the build stage
|
|
|
|
COPY --from=build /app/build/src/db/db /bin/db
|
|
|
|
COPY --from=build /app/build/src/game/game /bin/game
|
2023-12-10 10:00:55 +02:00
|
|
|
COPY --from=build /app/build/src/quest/qc /bin/qc
|
2023-12-07 22:12:45 +02:00
|
|
|
|
|
|
|
# Copy the game files
|
|
|
|
COPY ./gamefiles/ .
|
|
|
|
|
2023-12-10 10:00:55 +02:00
|
|
|
# Compile the quests
|
|
|
|
RUN cd /app/locale/english/quest && python2 make.py
|
|
|
|
|
2023-12-07 22:12:45 +02:00
|
|
|
# Symlink the configuration files
|
|
|
|
RUN ln -s "./conf/CMD" "CMD"
|
|
|
|
RUN ln -s ./conf/item_names_en.txt item_names.txt
|
|
|
|
RUN ln -s ./conf/item_proto.txt item_proto.txt
|
|
|
|
RUN ln -s ./conf/mob_names_en.txt mob_names.txt
|
|
|
|
RUN ln -s ./conf/mob_proto.txt mob_proto.txt
|