- NGINX image bumped to 1.29 - Debian image now used Trixie as the base - moved over to named release instead of "stable" due to package renaming
52 lines
1.4 KiB
Docker
52 lines
1.4 KiB
Docker
#
|
|
# Build stage
|
|
#
|
|
FROM debian:trixie-slim AS rr-builder
|
|
ARG RR_VERSION
|
|
|
|
# Install Essential Utilities
|
|
RUN apt-get update
|
|
RUN apt-get install -y bash git curl unzip build-essential cmake ninja-build
|
|
|
|
# Install dependencies
|
|
RUN apt-get install -y libcurl4-openssl-dev libsdl2-dev zlib1g-dev libpng-dev libogg-dev libvorbis-dev libvpx-dev libyuv-dev libopus-dev
|
|
|
|
# Clone the repo
|
|
RUN mkdir /buildfiles
|
|
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
|
|
|
|
#
|
|
# Server stage
|
|
#
|
|
FROM debian:stable-slim AS rr-server
|
|
ARG RR_VERSION
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install --no-install-recommends -y bash curl libsdl2-2.0-0 zlib1g libpng16-16 libogg0 libvorbis0a libvpx9 libyuv0 libopus0
|
|
|
|
# Create a 'ringracers' group and user
|
|
RUN useradd ringracers
|
|
USER ringracers
|
|
|
|
# After building, copy build files to new container
|
|
WORKDIR /home/ringracers/server
|
|
COPY --chown=ringracers:ringracers --from=rr-builder /buildfiles/RingRacers/build/ninja-release/bin/ringracers_$RR_VERSION .
|
|
COPY --chown=ringracers:ringracers ringserv-template.cfg .
|
|
|
|
# Copy runner script
|
|
WORKDIR /home/ringracers
|
|
COPY --chown=ringracers:ringracers run_server.sh .
|
|
RUN chmod +x run_server.sh
|
|
|
|
# Set up environment variables
|
|
ENV RINGRACERSWADDIR=/data/ringracers-data
|
|
ENV RR_VERSION=${RR_VERSION}
|
|
ENTRYPOINT [ "./run_server.sh" ]
|