mc-cluster/velocity-image/Dockerfile

63 lines
2.0 KiB
Docker
Raw Normal View History

2024-12-06 05:52:08 -05:00
FROM ubuntu:latest
# Update OS and install deps
RUN apt update && apt clean && apt upgrade -y
RUN apt install -y curl apt-utils sudo curl python3 python-is-python3 git wget nano openssh-server apt-transport-https zip
# Get JDK Ready
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /usr/share/keyrings/adoptium.asc
RUN echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
RUN cat /etc/apt/sources.list.d/adoptium.list
RUN sudo apt-get update
RUN apt update
# Install memory safe JDK
RUN DEBIAN_FRONTEND=noninteractive apt install temurin-21-jdk -y
# Download fabric server
# This needs to be changed to the version you wish to support.
RUN mkdir -vp /home/mc
RUN mkdir -vp /home/mc/minecraft
# Add a user
RUN useradd mc
# Let user use Bash
RUN usermod --shell /bin/bash mc
# Provide users ownership
RUN chown -R mc:mc /home/mc
ENV PATH="/usr/bin:$PATH"
RUN apt-get install -y ca-certificates curl gnupg
RUN sudo mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=18
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install nodejs -y
RUN npm install -g holesail
COPY pm2 /var/tools/pm2
RUN wget -O /home/mc/minecraft/server.jar https://api.papermc.io/v2/projects/velocity/versions/3.4.0-SNAPSHOT/builds/454/downloads/velocity-3.4.0-SNAPSHOT-454.jar
RUN chmod +x -R /var/tools
# Install PM2
RUN npm install pm2 -g
COPY velocity.toml /home/mc/minecraft
# Copy over start.sh to allow for backround run
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Set root pass
RUN echo 'root:noshallpass' | chpasswd
ENTRYPOINT ["/bin/bash", "/start.sh"]