diff --git a/Dockerfile b/Dockerfile index 83503dfa1..e4f813f15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,60 +1,24 @@ -FROM ubuntu:jammy AS builder +# run with flags --cap-add SYS_ADMIN --device /dev/fuse --security-opt apparmor:unconfined -RUN apt-get update -qy && \ - apt-get install -y software-properties-common wget && \ - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" && \ - apt-get update -qy && \ - apt-get upgrade -qy && \ - apt-get install -qy \ - clang-16 \ - cmake \ - git \ - libc++-16-dev \ - libc++abi-16-dev \ - libmbedtls-dev \ - libsodium-dev \ - libssl-dev \ - lld-16 \ - llvm \ - ninja-build \ - openssl +FROM ubuntu:latest -ENV CXX=clang++-16 -ENV CC=clang-16 -ENV BUILD_FOLDER_SUFFIX=headless +WORKDIR /app -COPY . /hypersomnia -WORKDIR /hypersomnia +RUN apt update +RUN apt install -y fuse +RUN apt install -y wget +RUN wget https://hypersomnia.xyz/builds/latest/Hypersomnia-Headless.AppImage +RUN chmod +x Hypersomnia-Headless.AppImage -RUN cmake/build.sh Release x64 "-DHEADLESS=1" && \ - ninja all -C build/current +RUN mkdir /root/.config +RUN mkdir /root/.config/Hypersomnia +RUN mkdir /root/.config/Hypersomnia/user +COPY server_config.lua /root/.config/Hypersomnia/user/config.lua -FROM ubuntu:jammy +CMD ["./Hypersomnia-Headless.AppImage"] -RUN apt-get update -qy && \ - apt-get install -y software-properties-common wget && \ - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ - add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" && \ - apt-get update -qy && \ - apt-get upgrade -qy && \ - apt-get install -qy \ - libc++abi1-16 \ - libc++1-16 \ - libsodium23 \ - libmbedcrypto7 \ - libmbedtls14 \ - libmbedx509-1 \ - openssl - -RUN useradd -m hypersomnia -COPY --from=builder /hypersomnia/hypersomnia /home/hypersomnia/hypersomnia -COPY --from=builder /hypersomnia/build/current/Hypersomnia /home/hypersomnia/hypersomnia/Hypersomnia -#COPY --from=builder /hypersomnia/hypersomnia/user/config.lua.example /hypersomnia/user/config.lua -RUN chown -R hypersomnia /home/hypersomnia/hypersomnia -RUN chgrp -R hypersomnia /home/hypersomnia/hypersomnia -USER hypersomnia - -WORKDIR /home/hypersomnia/hypersomnia +EXPOSE 8412/tcp EXPOSE 8412/udp -CMD ["./Hypersomnia", "--dedicated-server"] +EXPOSE 9000-9100/tcp +EXPOSE 9000-9100/udp + diff --git a/server_config.lua b/server_config.lua new file mode 100644 index 000000000..ee58a4c6c --- /dev/null +++ b/server_config.lua @@ -0,0 +1,19 @@ +return { + client = { + record_demo = false + }, + last_activity = "MAIN_MENU", + server = { + server_name = "Server" + }, + server_private = { + master_rcon_password = "1234", + rcon_password = "1234" + }, + server_start = { + port = 8412, + slots = 20 + }, + skip_tutorial = true +} +