Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
32 changes: 32 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -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