-
Notifications
You must be signed in to change notification settings - Fork 9
/
dockerfile
85 lines (68 loc) · 2.29 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Load nwnx image to import nwserver + nwnx plugins
ARG NWNX_VERSION
FROM nwnxee/unified:${NWNX_VERSION} as nwnx
# Remove incompatible plugins
RUN rm -rf /nwn/nwnx/NWNX_Ruby.so \
/nwn/nwnx/NWNX_SpellChecker.so \
/nwn/nwnx/NWNX_Redis.so
FROM ubuntu:20.04
COPY --from=nwnx /nwn /nwn
RUN apt-get update \
&& apt-get --no-install-recommends -y install ca-certificates wget \
&& wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get --no-install-recommends -y install libc6 libstdc++6 \
hunspell \
default-libmysqlclient-dev \
libmariadb3 \
libpq5 \
libsqlite3-0 \
luajit libluajit-5.1-2 \
inotify-tools \
patch \
unzip \
dotnet-runtime-8.0 \
dotnet-apphost-pack-8.0 \
&& rm -rf /var/cache/apt /var/lib/apt/lists/*
# Copy Anvil Binaries
ARG BINARY_PATH
COPY ${BINARY_PATH} /nwn/anvil/
# Define we are an Anvil based container
ENV ANVIL_IMAGE=1
# Set which kill signal to exit upon
STOPSIGNAL SIGINT
# Patch run-server.sh with our modifications
COPY ./scripts/run-server.patch /nwn
RUN patch /nwn/run-server.sh < /nwn/run-server.patch
# User Data
VOLUME /nwn/home
# Configure nwserver to run with nwnx
ENV NWNX_CORE_LOAD_PATH=/nwn/nwnx/
ENV NWN_LD_PRELOAD="/nwn/nwnx/NWNX_Core.so"
# Configure nwnx to run with anvil
ENV NWNX_DOTNET_SKIP=n
ENV NWNX_SWIG_DOTNET_SKIP=n
ENV NWNX_DOTNET_ASSEMBLY=/nwn/anvil/NWN.Anvil
# Use NWNX_ServerLogRedirector as default log manager
ENV NWNX_SERVERLOGREDIRECTOR_SKIP=n
ENV NWN_TAIL_LOGS=n
ENV NWNX_CORE_LOG_LEVEL=6
ENV NWNX_SERVERLOGREDIRECTOR_LOG_LEVEL=6
# Disable all other plugins by default.
ENV NWNX_CORE_SKIP_ALL=y
# Enable minidump generation
ENV DOTNET_DbgEnableMiniDump=1
ENV DOTNET_DbgMiniDumpType=3
ENV DOTNET_CreateDumpDiagnostics=1
ENV DOTNET_CreateDumpVerboseDiagnostics=1
ENV DOTNET_DbgMiniDumpName=/nwn/run/logs.0/anvil-crash-%t.dmp
ENV DOTNET_CreateDumpLogToFile=/nwn/run/logs.0/anvil-crash.log
# Entrypoint & Executable
EXPOSE ${NWN_PORT:-5121}/udp
RUN chmod +x /nwn/data/bin/linux-amd64/nwserver
RUN chmod +x /nwn/run-server.sh
ENV NWN_EXTRA_ARGS="-userdirectory /nwn/run"
WORKDIR /nwn/data/bin/linux-amd64
ENTRYPOINT ["/bin/bash", "/nwn/run-server.sh"]