From 5fb7c08135cfcae47b386a2ebcb057b9c587538c Mon Sep 17 00:00:00 2001 From: James Plante Date: Thu, 13 Feb 2025 23:27:52 -0500 Subject: [PATCH] Initial commit --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ build.sh | 13 +++++++++++++ compose.yml | 10 ++++++++++ data/_placeholder | 1 + 4 files changed, 56 insertions(+) create mode 100644 Dockerfile create mode 100644 build.sh create mode 100644 compose.yml create mode 100644 data/_placeholder diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..64d77b5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM alpine:3 + +# Install Essential Utilities +RUN apk update +RUN apk add bash git curl build-base unzip libc++-dev libc-dev lld cmake ninja make + +# Install dependencies +RUN apk add curl-dev sdl2-dev zlib-dev libpng-dev libogg-dev libvorbis-dev libvpx-dev +RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main libyuv libyuv-dev + +# Create a 'ringracers' group and user +RUN addgroup -S ringracers && adduser -S ringracers -G ringracers +RUN mkdir /buildfiles && chown ringracers:ringracers /buildfiles +USER ringracers + +# Clone the repo +WORKDIR /buildfiles/ +RUN git clone https://github.com/KartKrewDev/RingRacers.git + +# Build the code +WORKDIR /buildfiles/RingRacers +COPY --chown=ringracers:ringracers build.sh . +RUN chmod +x build.sh +RUN ./build.sh + +# After building +WORKDIR /home/ringracers + +# Set up environment variables +ENV RINGRACERSWADDIR=/data/ringracers-data + +ENTRYPOINT [ "server/ringracers_v2.3", "-dedicated" ] \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..c2b0f15 --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#! /bin/bash +RR_VERSION=2,3 +BUILDDIR=/buildfiles/RingRacers +OUTDIR=/home/ringracers/server + +cd $BUILDDIR +git fetch --tags +git switch --detach tags/v2.3 +cmake --preset ninja-release +cmake --build --preset ninja-release + +[[ -d $OUTDIR ]] || mkdir $OUTDIR +cp build/ninja-release/bin/ringracers_v2.3 $OUTDIR diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..e50a3a9 --- /dev/null +++ b/compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + ringracers: + build: + context: . + dockerfile: Dockerfile + ports: + - 5029:5029/udp + volumes: + - ./data:/data/ringracers-data \ No newline at end of file diff --git a/data/_placeholder b/data/_placeholder new file mode 100644 index 0000000..fc26ef1 --- /dev/null +++ b/data/_placeholder @@ -0,0 +1 @@ +Put the contents of the asset ZIP file in here \ No newline at end of file