2020-04-12 17:00:56 +08:00
|
|
|
FROM alpine:3.11
|
|
|
|
|
|
|
|
ENV MINETEST_GAME_VERSION master
|
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
COPY .git /usr/src/multicraft/.git
|
|
|
|
COPY CMakeLists.txt /usr/src/multicraft/CMakeLists.txt
|
|
|
|
COPY README.md /usr/src/multicraft/README.md
|
|
|
|
COPY multicraft.conf.example /usr/src/multicraft/multicraft.conf.example
|
|
|
|
COPY builtin /usr/src/multicraft/builtin
|
|
|
|
COPY cmake /usr/src/multicraft/cmake
|
|
|
|
COPY doc /usr/src/multicraft/doc
|
|
|
|
COPY fonts /usr/src/multicraft/fonts
|
|
|
|
COPY lib /usr/src/multicraft/lib
|
|
|
|
COPY misc /usr/src/multicraft/misc
|
|
|
|
COPY po /usr/src/multicraft/po
|
|
|
|
COPY src /usr/src/multicraft/src
|
|
|
|
COPY textures /usr/src/multicraft/textures
|
2020-04-12 17:00:56 +08:00
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
WORKDIR /usr/src/multicraft
|
2020-04-12 17:00:56 +08:00
|
|
|
|
|
|
|
RUN apk add --no-cache git build-base irrlicht-dev cmake bzip2-dev libpng-dev \
|
|
|
|
jpeg-dev libxxf86vm-dev mesa-dev sqlite-dev libogg-dev \
|
|
|
|
libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev \
|
2020-09-26 15:32:49 +02:00
|
|
|
gmp-dev jsoncpp-dev postgresql-dev luajit-dev ca-certificates && \
|
2020-04-12 17:00:56 +08:00
|
|
|
git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
|
2020-04-27 08:31:37 +02:00
|
|
|
rm -fr ./games/minetest_game/.git
|
|
|
|
|
|
|
|
WORKDIR /usr/src/
|
|
|
|
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
|
|
|
|
mkdir prometheus-cpp/build && \
|
|
|
|
cd prometheus-cpp/build && \
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DENABLE_TESTING=0 && \
|
|
|
|
make -j2 && \
|
|
|
|
make install
|
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
WORKDIR /usr/src/multicraft
|
2020-04-27 08:31:37 +02:00
|
|
|
RUN mkdir build && \
|
2020-04-12 17:00:56 +08:00
|
|
|
cd build && \
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DBUILD_SERVER=TRUE \
|
2020-04-27 08:31:37 +02:00
|
|
|
-DENABLE_PROMETHEUS=TRUE \
|
2020-04-16 20:43:49 +02:00
|
|
|
-DBUILD_UNITTESTS=FALSE \
|
2020-04-12 17:00:56 +08:00
|
|
|
-DBUILD_CLIENT=FALSE && \
|
|
|
|
make -j2 && \
|
|
|
|
make install
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-04-12 17:00:56 +08:00
|
|
|
FROM alpine:3.11
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-09-26 15:32:49 +02:00
|
|
|
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit && \
|
2020-08-25 09:59:52 +02:00
|
|
|
adduser -D multicraft --uid 30000 -h /var/lib/multicraft && \
|
|
|
|
chown -R multicraft:multicraft /var/lib/multicraft
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
WORKDIR /var/lib/multicraft
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
COPY --from=0 /usr/local/share/multicraft /usr/local/share/multicraft
|
|
|
|
COPY --from=0 /usr/local/bin/multicraftserver /usr/local/bin/multicraftserver
|
|
|
|
COPY --from=0 /usr/local/share/doc/multicraft/multicraft.conf.example /etc/multicraft/multicraft.conf
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
USER multicraft:multicraft
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-04-27 08:31:37 +02:00
|
|
|
EXPOSE 30000/udp 30000/tcp
|
2018-12-12 00:00:08 +01:00
|
|
|
|
2020-08-25 09:59:52 +02:00
|
|
|
CMD ["/usr/local/bin/multicraftserver", "--config", "/etc/multicraft/multicraft.conf"]
|