From f354a113f6c1477442ea6602f7a21554ccd7d702 Mon Sep 17 00:00:00 2001 From: cadyn <35672377+cadyn@users.noreply.github.com> Date: Sat, 30 Apr 2022 14:27:28 -0700 Subject: [PATCH 1/2] Create Dockerfile --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..76aab7d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /source + +# copy csproj and restore as distinct layers +COPY *.sln . +COPY SS14.Watchdog/*.csproj ./SS14.Watchdog/ +COPY SS14.Watchdog.Tests/*.csproj ./SS14.Watchdog.Tests/ +RUN dotnet restore -r linux-x64 + +# copy everything else and build app +COPY SS14.Watchdog/. ./SS14.Watchdog/ +COPY SS14.Watchdog.Tests/. ./SS14.Watchdog.Tests/ +WORKDIR /source/SS14.Watchdog/ +RUN dotnet publish -c release -r linux-x64 -o /app --no-self-contained --no-restore + +# final stage/image +FROM mcr.microsoft.com/dotnet/sdk:6.0 + +# dependencies +RUN apt-get update \ + && apt-get install -y git python3 python-is-python3 + +WORKDIR /app +COPY --from=build /app ./ + +EXPOSE 5000 +EXPOSE 1212 + +ENV DOTNET_ENVIRONMENT Production + +VOLUME ["/app/instances"] + +ENTRYPOINT ["/app/SS14.Watchdog"] +#ENTRYPOINT ["dotnet", "SS14.Watchdog.dll"] From 5510b9581ff82a33ddce45183a1f15602406b50d Mon Sep 17 00:00:00 2001 From: cadyn <35672377+cadyn@users.noreply.github.com> Date: Sat, 30 Apr 2022 14:27:51 -0700 Subject: [PATCH 2/2] Add instructions for docker container --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 16abc23..959df71 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,16 @@ SS14.Watchdog (codename Ian) is SS14's server-hosting wrapper thing, similar to [TGS](https://github.com/tgstation/tgstation-server) for BYOND (but much simpler for the time being). It handles auto updates, monitoring, automatic restarts, and administration. We recommend you use this for proper deployments. Documentation on how setup and use for SS14.Watchdog is [here](https://docs.spacestation14.io/en/getting-started/hosting#ss14watchdog). + +## Docker +For convenience, a docker image is provided, with an example use below: +```sh +docker run \ +--name="ss14" \ +-p 5000:5000 \ +-p 1212:1212 \ +-p 1212:1212/udp \ +-v /path/to/appsettings.yml:/app/appsettings.yml \ +-v /path/to/instances/folder:/app/instances \ +cadynz/ss14-watchdog +```