diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..4a6c8cd --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,33 @@ +name: Build and Push Domain Server Images + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: docker + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + + - name: Build server runtime with compiled binaries + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile.runtime + push: true + tags: ghcr.io/${{ github.repository }}/domain-server:latest \ No newline at end of file diff --git a/Dockerfile.build b/Dockerfile.build index 9318647..50aa1a2 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,9 +1,6 @@ # Docker environment for building Overte server FROM ubuntu:22.04 -ARG REPO=https://github.com/overte-org/overte -ARG TAG=master - ARG DEBIAN_FRONTEND=noninteractive ARG TERM=linux @@ -11,11 +8,11 @@ RUN mkdir /opt/overte-build \ && mkdir /opt/overte # Install dependencies -RUN apt update && apt install -y tzdata curl ninja-build git cmake g++ npm libssl-dev python3-distutils python3-distro mesa-common-dev libgl1-mesa-dev \ +RUN apt update && apt install -y python3-full zip tzdata curl ninja-build git cmake g++ npm libssl-dev python3-distutils python3-distro mesa-common-dev libgl1-mesa-dev \ libqt5websockets5-dev qtscript5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5webchannel5-dev qtwebengine5-dev libqt5xmlpatterns5-dev # Fetch repository -RUN git clone --depth 1 --branch $TAG $REPO /opt/overte-build/ +RUN git clone https://github.com/overte-org/overte.git /opt/overte-build/ # Build just the server RUN cd /opt/overte-build \ @@ -25,8 +22,14 @@ RUN cd /opt/overte-build \ && export RELEASE_TYPE=PRODUCTION \ && cmake -DSERVER_ONLY=1 -DOVERTE_CPU_ARCHITECTURE=-msse3 .. +# put number after -j to limit cores. RUN cd /opt/overte-build/build \ - && make + && make -j + +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" RUN mv /opt/overte-build/build/libraries /opt/overte/libraries \ && mv /opt/overte-build/build/assignment-client/assignment-client /opt/overte/assignment-client \ diff --git a/Dockerfile.runtime b/Dockerfile.runtime index 00200a1..492ec00 100644 --- a/Dockerfile.runtime +++ b/Dockerfile.runtime @@ -1,7 +1,7 @@ # Overte Server runtime image. domain-server-builder must be built first. -FROM domain-server-builder as build +FROM ghcr.io/overte-org/overte-domain-server-docker/domain-server-builder:latest as build -LABEL maintainer="Micah (https://github.com/akamicah)" +LABEL maintainer="OfficialR3ido101 (https://github.com/OfficialR3ido101)" LABEL description="Overte domain server runtime" FROM ubuntu:22.04 @@ -23,6 +23,7 @@ RUN apt clean && rm -rf /var/lib/app/lists/* # Install libraries COPY --from=build /opt/overte/libraries/*/*.so /lib/ +COPY --from=build /opt/overte/libraries/libnode.so.108 /lib/ # Fetch built services RUN mkdir /opt/overte @@ -35,8 +36,8 @@ RUN chmod +x /opt/overte/domain-server && \ chmod +x /opt/overte/assignment-client # Server run test -RUN /opt/overte/domain-server --version > /opt/overte/version && \ - /opt/overte/assignment-client --version >> /opt/overte/version +# RUN /opt/overte/domain-server --version > /opt/overte/version && \ +# /opt/overte/assignment-client --version >> /opt/overte/version # Install supervisor config COPY ./files/overte.conf /etc/supervisor/conf.d/overte.conf diff --git a/README.md b/README.md index 7483d2c..b377c87 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Build Status + +[![Docker Build](https://github.com/terminalx-resonite/overte-domain-server-docker/actions/workflows/deploy.yaml/badge.svg)](https://github.com/terminalx-resonite/overte-domain-server-docker/actions/workflows/deploy.yaml) + # Overte Domain Server Docker Images Contained in this repo are two docker images which are used to build and run the Overte domain server as a docker image. @@ -24,5 +28,5 @@ docker run -d --name overte-server -p 40100-40102:40100-40102 -p 40100-40102:401 # Prebuilt Image -If you would prefer, a prebuilt image for amd64 environments can be used by replacing `domain-server` with `akamicah/overte-domain-server:latest` in either the `docker run` command or the `docker-compose.yml` file. +If you would prefer, a prebuilt image for amd64 environments can be used by replacing `domain-server` with `ghcr.io/overte-org/overte-domain-server-docker/domain-server:latest` in either the `docker run` command or the `docker-compose.yml` file. diff --git a/docker-compose.yml b/docker-compose.yml index 1e321c7..d6fcb4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: overte-server: #image: domain-server - image: akamicah/overte-domain-server:latest + image: ghcr.io/overte-org/overte-domain-server-docker/domain-server:latest container_name: overte-server restart: unless-stopped expose: diff --git a/files/overte.conf b/files/overte.conf index a044d3a..c4c65e2 100644 --- a/files/overte.conf +++ b/files/overte.conf @@ -57,3 +57,4 @@ autorestart=unexpected directory=/opt/overte stderr_logfile=/var/log/overte-err.log stdout_logfile=/var/log/overte-out.log +