diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d63fd5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +WORKDIR /build +COPY *.sln . +COPY SS14.Watchdog/. ./SS14.Watchdog/ +COPY SS14.Watchdog.Tests/. ./SS14.Watchdog.Tests/ + +RUN dotnet publish -c Release -r linux-x64 --no-self-contained -o /publish +RUN dotnet test + +FROM build AS dev +WORKDIR /watchdog +COPY --from=build /publish . +RUN chmod +x ./SS14.Watchdog +CMD ["./SS14.Watchdog"] + +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime +WORKDIR /watchdog +COPY --from=build /publish . +RUN chmod +x ./SS14.Watchdog +CMD ["./SS14.Watchdog"] \ No newline at end of file diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..b67f967 --- /dev/null +++ b/compose.yml @@ -0,0 +1,32 @@ +x-watchdog-base: &watchdog-base + build: + context: . + environment: + - ASPNETCORE_URLS=${WATCHDOG_URL} + ports: + - ${WATCHDOG_PORT}:${WATCHDOG_PORT} + - ${SS14_PORT}:${SS14_PORT}/tcp + - ${SS14_PORT}:${SS14_PORT}/udp + restart: unless-stopped + volumes: + - ./instances:/watchdog/instances + - ./SS14.Watchdog/appsettings.yml:/watchdog/appsettings.yml + +services: + watchdog: + <<: *watchdog-base + container_name: ss14-watchdog + build: + context: . + target: runtime + profiles: + - prod + + watchdog-dev: + <<: *watchdog-base + container_name: ss14-watchdog-dev + build: + context: . + target: dev + profiles: + - dev \ No newline at end of file