2024-05-01 01:10:02 +03:00
|
|
|
FROM ubuntu:22.04 as build
|
2023-12-07 22:12:45 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-05-25 20:00:26 +03:00
|
|
|
# Set up the CMake repository
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates gpg wget
|
|
|
|
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
|
|
|
|
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
|
|
|
|
|
2023-12-07 22:12:45 +02:00
|
|
|
# Update the system and install various dependencies
|
|
|
|
RUN apt-get update && \
|
2024-01-09 18:26:50 +02:00
|
|
|
apt-get install -y git cmake ninja-build build-essential tar curl zip unzip pkg-config autoconf python3 \
|
2024-05-31 12:49:21 +03:00
|
|
|
libdevil-dev libncurses5-dev libbsd-dev
|
2023-12-07 22:12:45 +02:00
|
|
|
|
2024-01-09 18:26:50 +02:00
|
|
|
# Arm specific
|
|
|
|
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
|
|
|
|
|
2023-12-07 22:12:45 +02:00
|
|
|
# Install vcpkg and the required libraries
|
|
|
|
RUN git clone https://github.com/Microsoft/vcpkg.git
|
|
|
|
RUN bash ./vcpkg/bootstrap-vcpkg.sh
|
2024-05-31 12:49:21 +03:00
|
|
|
RUN ./vcpkg/vcpkg install boost-system cryptopp effolkronium-random libmysql libevent lzo fmt spdlog argon2
|
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)
|
|
|
|
|
2024-05-01 01:10:02 +03:00
|
|
|
FROM ubuntu:22.04 as app
|
2023-12-07 22:12:45 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-06-02 21:45:51 +03:00
|
|
|
RUN apt-get update && apt-get install -y gettext 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/ .
|
|
|
|
|
2024-06-02 21:45:51 +03:00
|
|
|
# Copy the auxiliary files
|
|
|
|
COPY ./docker/ .
|
|
|
|
|
2023-12-10 10:00:55 +02:00
|
|
|
# Compile the quests
|
2024-05-25 20:00:26 +03:00
|
|
|
RUN cd /app/data/quest && python2 make.py
|
2023-12-10 10:00:55 +02:00
|
|
|
|
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
|
2024-06-02 21:45:51 +03:00
|
|
|
|
|
|
|
# Set up default environment variables
|
|
|
|
ENV PUBLIC_BIND_IP 0.0.0.0
|
|
|
|
ENV INTERNAL_BIND_IP 0.0.0.0
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/bash", "docker-entrypoint.sh"]
|