diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef80d3d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build + +WORKDIR /build +ADD . . + +RUN dotnet publish -c Release -r linux-x64 --no-self-contained + +FROM mcr.microsoft.com/dotnet/sdk:8.0 + +# These are apparently required dependencies. +RUN apt update -y && \ + apt install -y git python3 python-is-python3 + +COPY --from=build /build/SS14.Watchdog/bin/Release/net8.0/linux-x64/publish /watchdog + +WORKDIR /watchdog + +# Both TCP and UDP traffic must be explicitly exposed on port 1212 +EXPOSE 1212/tcp +EXPOSE 1212/udp +EXPOSE 8080/tcp + +VOLUME ["/watchdog/instances"] + +ENV DOTNET_ENVIRONMENT Production + +ENTRYPOINT ["./SS14.Watchdog"] diff --git a/README.md b/README.md index 1687a9b..2d77c10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,26 @@ -# SS14.Watchdog +# SS14.Watchdog SS14.Watchdog 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#watchdog). + +## Docker +To build and run Watchdog in a Docker container: + +```sh +docker build -t ss14-watchdog . +docker run \ + -p 1212:1212/tcp \ + -p 1212:1212/udp \ + -p 8080:8080/tcp \ + -v /path/to/instances/:/watchdog/instances/ \ + -v /path/to/appsettings.yml:/watchdog/appsettings.yml \ + ss14-watchdog +``` + +To deploy with docker compose, edit `docker-compose.yml` to your liking, supplying your own appsettings.yml if needed, then run: + +```sh +docker compose build +docker compose up -d +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6cf6634 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + ss14-watchdog: + build: . + image: ss14-watchdog + restart: always + ports: + - 8080:8080/tcp + - 1212:1212/tcp + - 1212:1212/udp + volumes: + - instances:/watchdog/instances/ + # # Uncomment to supply your own appsettings.yml + # - type: bind + # source: /tmp/appsettings.yml + # target: /watchdog/appsettings.yml + +volumes: + instances: