1
0

109 lines
3.0 KiB
Docker
Raw Normal View History

2022-04-09 13:05:37 +02:00
FROM alpine:3.14
ENV MINETEST_GAME_VERSION original-2.0.3
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-08-25 09:59:52 +02:00
WORKDIR /usr/src/multicraft
RUN apk add --no-cache git build-base \
bzip2-dev \
cmake \
gmp-dev \
curl-dev \
freetype-dev \
gettext-dev \
hiredis-dev \
libjpeg-turbo-dev \
irrlicht-dev \
libogg-dev \
libpng-dev \
libvorbis-dev \
libxi-dev \
luajit-dev \
jsoncpp-dev \
mesa-dev \
openal-soft-dev \
openssl-dev \
samurai \
postgresql-dev \
sqlite-dev \
zlib-dev \
zstd-dev \
libxxf86vm-dev \
ca-certificates && \
git clone --depth=1 -b master https://codeberg.org/minenux/minetest-game-minetest.git ./games/minetest_game && \
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 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 && \
make -j2 && \
make install
2020-08-25 09:59:52 +02:00
WORKDIR /usr/src/multicraft
RUN mkdir build && \
cd build && \
cmake .. \
-DENABLE_PROMETHEUS=TRUE \
-DBUILD_UNITTESTS=FALSE \
-DCUSTOM_BINDIR=/usr/bin \
-DCUSTOM_DOCDIR="/usr/share/doc/$pkgname" \
-DCUSTOM_SHAREDIR="/usr/share/games/$pkgname" \
-DBUILD_SERVER=ON \
-DRUN_IN_PLACE=OFF \
-DENABLE_CURL=ON \
-DENABLE_SOUND=ON \
-DENABLE_LUAJIT=ON \
-DENABLE_GETTEXT=ON \
-DENABLE_FREETYPE=ON \
-DENABLE_SYSTEM_GMP=ON \
-DENABLE_SYSTEM_JSONCPP=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_SPATIAL=ON \
-DENABLE_LEVELDB=ON \
-DENABLE_REDIS=OFF \
-DENABLE_POSTGRESQL=ON \
-DJSON_INCLUDE_DIR=/usr/include/jsoncpp \
-DFREETYPE_INCLUDE_DIR_freetype2=/usr/include/freetype2 \
-DFREETYPE_INCLUDE_DIR_ft2build=/usr/include \
-DLEVELDB_INCLUDE_DIR=/usr/include/leveldb \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DBUILD_CLIENT=FALSE && \
make -j2 && \
make install
2022-04-09 13:05:37 +02:00
FROM alpine:3.14
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit && \
adduser -D multicraft --uid 30000 -h /var/games/multicraft && \
chown -R multicraft:multicraft /var/games/multicraft
WORKDIR /var/games/multicraft
2020-08-25 09:59:52 +02:00
COPY --from=0 /usr/local/share/doc/multicraft/multicraft.conf.example /etc/multicraft/multicraft.conf
2020-08-25 09:59:52 +02:00
USER multicraft:multicraft
EXPOSE 30000/udp 30000/tcp
CMD ["/usr/bin/multicraftserver", "--port", "30000", "--config", "/etc/multicraft/multicraft.conf", "--logfile", "/var/games/multicraft.log", "--server"]