2024-01-02 15:42:03 +00:00
|
|
|
FROM gcc:12 as build
|
2024-01-02 01:15:37 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
apt-get update; \
|
|
|
|
apt-get install -y cmake
|
|
|
|
|
|
|
|
COPY . /app/
|
2024-01-02 15:42:03 +00:00
|
|
|
COPY --chmod=0500 ./build.sh /app/
|
2024-01-02 01:15:37 +00:00
|
|
|
|
|
|
|
RUN sed -i 's/MARIADB_CONNECTOR_COMPILE_JOBS__=.*/MARIADB_CONNECTOR_COMPILE_JOBS__=2/' /app/CMakeVariables.txt
|
|
|
|
|
|
|
|
RUN ./build.sh
|
|
|
|
|
2024-01-02 15:42:03 +00:00
|
|
|
FROM debian:12 as runtime
|
2024-01-02 01:15:37 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-01-02 15:42:03 +00:00
|
|
|
RUN --mount=type=cache,id=build-apt-cache,target=/var/cache/apt \
|
|
|
|
apt update && \
|
|
|
|
apt install -y libssl3 libcurl4 && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Grab libraries and load them
|
2024-01-02 15:52:16 +00:00
|
|
|
COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/libmariadbcpp.so /usr/local/lib/
|
2024-01-02 15:42:03 +00:00
|
|
|
COPY --from=build /app/build/mariadbcpp/src/mariadb_connector_cpp-build/libmariadb/libmariadb/libmariadb.so.3 /usr/local/lib
|
|
|
|
RUN ldconfig
|
|
|
|
|
|
|
|
# Server bins
|
2024-01-02 01:15:37 +00:00
|
|
|
COPY --from=build /app/build/*Server /app/
|
2024-01-02 15:42:03 +00:00
|
|
|
|
|
|
|
# Necessary suplimentary files
|
2024-01-02 19:35:50 +00:00
|
|
|
COPY --from=build /app/build/*.ini /app/configs/
|
|
|
|
COPY --from=build /app/build/vanity/*.* /app/vanity/*
|
2024-01-02 01:15:37 +00:00
|
|
|
COPY --from=build /app/build/navmeshes /app/navmeshes
|
|
|
|
COPY --from=build /app/build/migrations /app/migrations
|
|
|
|
COPY --from=build /app/build/*.dcf /app/
|
2024-01-02 03:30:01 +00:00
|
|
|
|
2024-01-02 19:46:05 +00:00
|
|
|
# backup of config and vanity files to copy to the host incase
|
|
|
|
# of a mount clobbering the copy from above
|
|
|
|
COPY --from=build /app/build/*.ini /app/default-configs/
|
|
|
|
COPY --from=build /app/build/vanity/*.* /app/default-vanity/*
|
|
|
|
|
2024-01-02 01:15:37 +00:00
|
|
|
# needed as the container runs with the root user
|
|
|
|
# and therefore sudo doesn't exist
|
|
|
|
ENV USE_SUDO_AUTH=0
|
2024-01-02 19:35:50 +00:00
|
|
|
ENV DLU_CONFIG_DIR=/app/configs/
|
2024-01-02 03:30:01 +00:00
|
|
|
|
2024-01-02 15:42:03 +00:00
|
|
|
COPY --chmod=0500 ./entrypoint.sh /app/
|
2024-01-02 03:30:01 +00:00
|
|
|
ENTRYPOINT [ "/app/entrypoint.sh" ]
|