minetest-server-docker/Dockerfile

40 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2024-09-21 20:14:52 +03:00
FROM debian:12
RUN echo "Building image with gameid: $gameid"
2024-09-21 20:14:52 +03:00
#Update
RUN apt update -y && apt upgrade -y
2024-09-28 16:35:28 +03:00
RUN apt install -y tmux wget curl unzip git g++ make libc6-dev cmake libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev libncurses5-dev
2024-09-21 20:14:52 +03:00
2024-09-29 17:52:04 +03:00
#Get minetest sources
2024-09-21 20:14:52 +03:00
RUN useradd -ms /bin/bash minetest
USER minetest
WORKDIR /home/minetest
RUN git clone --depth 1 https://github.com/minetest/minetest.git minetest-source
RUN mkdir /home/minetest/minetest-source/build
WORKDIR /home/minetest/minetest-source/build
2024-09-28 17:45:44 +03:00
RUN cmake -DBUILD_SERVER=TRUE -DBUILD_CLIENT=FALSE -DENABLE_CURL=ON -DENABLE_CURSES=ON -DENABLE_POSTGRES=ON -DENABLE_SOUND=OFF ..
2024-09-21 20:14:52 +03:00
RUN make -j 6
2024-09-29 17:52:04 +03:00
2024-09-21 20:14:52 +03:00
USER root
WORKDIR /home/minetest/minetest-source/build
2024-09-29 17:52:04 +03:00
#Compile and install minetest-server
RUN make install
2024-09-29 17:49:23 +03:00
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chown -R minetest:minetest /usr/local/share/minetest
2024-09-21 20:14:52 +03:00
2024-09-29 17:52:04 +03:00
#Cleanup
WORKDIR /usr/local/share/minetest
RUN rm -rf /home/minetest/minetest-source/
2024-09-29 17:49:23 +03:00
USER minetest
WORKDIR /usr/local/share/minetest
2024-09-29 18:29:50 +03:00
RUN mkdir -p worlds
2024-09-28 16:35:28 +03:00
2024-09-29 17:49:23 +03:00
EXPOSE 30000/udp
ENTRYPOINT ["/entrypoint.sh"]