Initial commit

This commit is contained in:
James Plante 2025-02-13 23:27:52 -05:00
commit 5fb7c08135
4 changed files with 56 additions and 0 deletions

32
Dockerfile Normal file
View File

@ -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" ]

13
build.sh Normal file
View File

@ -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

10
compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '3'
services:
ringracers:
build:
context: .
dockerfile: Dockerfile
ports:
- 5029:5029/udp
volumes:
- ./data:/data/ringracers-data

1
data/_placeholder Normal file
View File

@ -0,0 +1 @@
Put the contents of the asset ZIP file in here