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"] 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 +```