docker-tribesnext-server/Dockerfile

113 lines
2.6 KiB
Docker
Raw Normal View History

# Multi-Stage Build (TacoServer)
# This stage compiles the various resources that make up TacoServer
FROM alpine:3.10 as tacobuilder
RUN apk --update add git sed less wget nano openssh && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*
WORKDIR /tmp
2023-10-02 15:16:09 +00:00
RUN git clone --depth 1 "https://github.com/ChocoTaco1/TacoServer/" && cd ./TacoServer
WORKDIR /tmp
RUN git clone --depth 1 "https://github.com/ChocoTaco1/TacoMaps/" && cd ./TacoMaps
WORKDIR /tmp
RUN git clone --depth 1 "https://github.com/ChocoTaco1/NoTNscripts/" && cd ./NoTNscripts
# Main Game Server Image
2023-10-02 15:16:09 +00:00
FROM i386/debian:bookworm
LABEL maintainer="sairuk, battlelore, chocotaco"
2019-02-13 09:41:52 +00:00
# ENVIRONMENT
ARG SRVUSER=gameserv
ARG SRVUID=1000
ARG SRVDIR=/tmp/tribes2/
2020-01-02 20:10:26 +00:00
ENV INSTDIR=/home/${SRVUSER}/.loki/tribes2/
2020-01-05 20:37:15 +00:00
ENV TZ="America/New_York"
# -- shutup installers
ENV DEBIAN_FRONTEND noninteractive
2019-02-13 09:41:52 +00:00
# UPDATE IMAGE
RUN dpkg --add-architecture i386
RUN apt-get -y update --fix-missing && apt-get -y upgrade
2019-02-13 09:41:52 +00:00
# DEPENDENCIES
RUN apt-get -y install \
# -- access
sudo unzip \
# -- logging
rsyslog \
# -- utilities
2023-10-02 17:54:02 +00:00
sed less nano vim file wget curl gnupg2 netcat-traditional software-properties-common xdelta3 tzdata
2019-02-13 09:41:52 +00:00
2020-01-05 20:37:15 +00:00
#RUN timedatectl set-timezone ${TZ}
2019-02-13 09:41:52 +00:00
# CLEAN IMAGE
RUN apt-get -y clean && apt-get -y autoremove
# USER
# -- add the user, expose datastore
RUN useradd -m -s /bin/bash -u ${SRVUID} ${SRVUSER}
# -- temporarily steal ownership
RUN chown -R root: /home/${SRVUSER}
2020-01-02 20:10:26 +00:00
2019-02-13 09:41:52 +00:00
# SCRIPT - installer
COPY _scripts/tribesnext-server-installer ${SRVDIR}
RUN chmod +x ${SRVDIR}/tribesnext-server-installer
RUN ${SRVDIR}/tribesnext-server-installer
# SCRIPT - server (default)
2023-10-02 21:47:17 +00:00
COPY _scripts/start-server ${INSTDIR}/start-server
RUN chmod +x ${INSTDIR}/start-server
2019-02-13 09:41:52 +00:00
# TacoServer - Pull in resources from builder
2020-01-02 20:10:26 +00:00
COPY --from=tacobuilder /tmp/TacoServer/Classic/. ${INSTDIR}/Classic/.
COPY --from=tacobuilder /tmp/TacoMaps/. ${INSTDIR}/Classic/Maps/
COPY --from=tacobuilder /tmp/NoTNscripts/. ${INSTDIR}/Classic/.
# CLEAN UP
COPY _scripts/clean-up ${SRVDIR}
RUN chmod +x ${SRVDIR}/clean-up
RUN ${SRVDIR}/clean-up ${INSTDIR}
2019-02-13 09:41:52 +00:00
# SCRIPT - custom (custom content / overrides)
COPY _custom/. ${INSTDIR}
2019-02-13 09:41:52 +00:00
# SCRIPT - expand admin prefs
COPY _scripts/cfg-admin-prefs ${SRVDIR}
RUN chmod +x ${SRVDIR}/cfg-admin-prefs
2020-01-02 20:10:26 +00:00
# SCRIPT - generate our alphabetized autoexec index
COPY _scripts/gen_autoexec_index ${SRVDIR}
RUN chmod +x ${SRVDIR}/gen_autoexec_index
# SCRIPT - heartbeat to TribesNext's master server
COPY _scripts/tn_heartbeat ${SRVDIR}
RUN chmod +x ${SRVDIR}/tn_heartbeat
2019-02-13 09:41:52 +00:00
# PERMISSIONS
RUN chown -R ${SRVUSER}: /home/${SRVUSER}
# PORTS
EXPOSE \
# -- tribes
666/tcp \
2023-10-02 15:16:09 +00:00
28000/udp
2019-02-13 09:41:52 +00:00
USER ${SRVUSER}
WORKDIR ${INSTDIR}
CMD ["./start-server"]
2019-02-13 09:41:52 +00:00