overte-domainserver-aio/Dockerfile

92 lines
3 KiB
Text
Raw Permalink Normal View History

2024-12-19 13:22:54 +01:00
FROM alveusdev/overtedomainserver-buildenv:latest AS build
ARG REPO=https://github.com/overte-org/overte
ARG TAG=master
ARG DEBIAN_FRONTEND=noninteractive
ARG TERM=linux
2024-12-20 22:53:15 +01:00
ARG MAKEFLAGS=-j4
2024-12-19 13:22:54 +01:00
# Create build and output directory
RUN mkdir /opt/overte-build \
&& mkdir /opt/overte
# Fetch repository
RUN git clone --depth 1 --branch $TAG $REPO /opt/overte-build/
# Build just the server
RUN cd /opt/overte-build \
&& mkdir build \
&& cd ./build \
&& export OVERTE_USE_SYSTEM_QT=1 \
&& export RELEASE_TYPE=PRODUCTION \
2024-12-20 22:53:15 +01:00
&& export RELEASE_NUMBER=${TAG} \
&& if [ $(uname -m) == "x86_64" ]; then \
# amd64 \
2024-12-20 22:59:26 +01:00
cmake -G "Unix Makefiles" -DSERVER_ONLY=1 -DBUILD_TOOLS=1 -DOVERTE_CPU_ARCHITECTURE=-msse3 ..; \
2024-12-20 22:53:15 +01:00
else \
# aarch64 \
2024-12-20 22:59:26 +01:00
VCPKG_FORCE_SYSTEM_BINARIES=1 cmake -G "Unix Makefiles" -DSERVER_ONLY=1 -DBUILD_TOOLS=1 -DOVERTE_CPU_ARCHITECTURE= ..; \
2024-12-20 22:53:15 +01:00
fi
# put number after -j to limit cores.
2024-12-19 13:22:54 +01:00
RUN cd /opt/overte-build/build \
2024-12-20 22:53:15 +01:00
&& make -j`nproc` domain-server \
&& make -j`nproc` assignment-client \
&& make -j`nproc` oven # needed for baking
RUN VCPKG_PATH=$(python3 /opt/overte-build/prebuild.py --get-vcpkg-path --build-root . --quiet) && \
echo "VCPKG Path: $VCPKG_PATH" && \
find "$VCPKG_PATH" -type f -name "libnode.so.108" -exec cp {} /opt/overte-build/build/libraries \; || \
echo "libnode.so.108 not found in $VCPKG_PATH"
2024-12-19 13:22:54 +01:00
2024-12-20 22:53:15 +01:00
# Move built binaries etc to output directory
2024-12-19 13:22:54 +01:00
RUN mv /opt/overte-build/build/libraries /opt/overte/libraries \
&& mv /opt/overte-build/build/assignment-client/assignment-client /opt/overte/assignment-client \
&& mv /opt/overte-build/build/assignment-client/plugins /opt/overte/plugins \
&& mv /opt/overte-build/build/domain-server/domain-server /opt/overte/domain-server \
&& mv /opt/overte-build/domain-server/resources /opt/overte/resources
# Runtime
2024-12-20 22:53:15 +01:00
FROM debian:bookworm-slim AS runtime
2024-12-19 13:22:54 +01:00
LABEL maintainer="alveus.dev"
LABEL description="Overte Domain Server AIO"
ARG DEBIAN_FRONTEND=noninteractive
ARG TERM=linux
RUN echo UTC >/etc/timezone
# Install libraries
COPY --from=build /opt/overte/libraries/*/*.so /lib/
RUN mkdir /opt/overte
# Fetch built services
COPY --from=build /opt/overte/domain-server /opt/overte
COPY --from=build /opt/overte/assignment-client /opt/overte
COPY --from=build /opt/overte/plugins /opt/overte/plugins
COPY --from=build /opt/overte/resources /opt/overte/resources
RUN chmod +x /opt/overte/domain-server && \
chmod +x /opt/overte/assignment-client
# Run test
RUN /opt/overte/domain-server --version > /opt/overte/version && \
/opt/overte/assignment-client --version >> /opt/overte/version
# Install supervisor config
COPY ./services.conf /etc/supervisor/conf.d/overte.conf
RUN mkdir /var/log/overte
# Expose required ports
EXPOSE 40100 40101 40102
EXPOSE 40100/udp 40101/udp 40102/udp
EXPOSE 48000/udp 48001/udp 48002/udp 48003/udp 48004/udp 48005/udp 48006/udp
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/overte.conf"]