# nwnee files FROM beamdog/nwserver:latest AS nwn RUN chmod +x /nwn/data/bin/linux-x86/nwserver-linux # builder FROM rustlang/rust:nightly-bullseye AS builder COPY . /usr/src/ WORKDIR /usr/src/runtime RUN cargo build --package nwn-rs-runtime --release # runtime FROM debian:bookworm-slim AS runtime COPY --from=nwn /nwn /nwn COPY nwn-rs-runtime/scripts/run-server.sh /nwn/run-server.sh RUN mkdir -p /nwn/home VOLUME /nwn/home ENV NWN_TAIL_LOGS=y ENV NWN_EXTRA_ARGS="-userdirectory /nwn/run" COPY --from=builder /usr/src/target/release/libruntime.so /nwn/rs/runtime.so RUN runDeps="libc6 \ libstdc++6 \ inotify-tools" \ && apt-get update \ && apt-get --no-install-recommends -y install $runDeps \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* ENV RUST_BACKTRACE=1 ENV NWN_RS_LOGLEVEL=info WORKDIR /nwn/data/bin/linux-x86 ENTRYPOINT ["/bin/bash", "/nwn/run-server.sh"]