Skip to content

Commit

Permalink
Update Dockerfile TeamHypersomnia#286 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
BoskoDelic committed Jun 14, 2024
1 parent a8abfb8 commit 68c095b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 53 deletions.
70 changes: 17 additions & 53 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

19 changes: 19 additions & 0 deletions server_config.lua
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 68c095b

Please sign in to comment.