From d9eb9ff663c1785fa564a4abbd897c0db4e1bd46 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Fri, 25 Oct 2024 14:28:39 +0500 Subject: [PATCH] new: add Dockerfile and compose.yaml --- Dockerfile | 17 +++++++++++++++++ compose.yaml | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..680d5c8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:35792ea4ad1db051981f62b313f1be3b46b1f45cadbaa3c288cd0d3056eefb83 AS build-env +WORKDIR /Octobot + +# Copy everything +COPY . ./ +# Restore as distinct layers +RUN dotnet restore +# Load build argument with publish options +ARG PUBLISH_OPTIONS +# Build and publish a release +RUN dotnet publish ./TeamOctolings.Octobot.csproj $OPTIONS -o out + +# Build runtime image +FROM mcr.microsoft.com/dotnet/runtime:8.0@sha256:a335dccd3231f7f9e2122691b21c634f96e187d3840c8b7dbad61ee09500e408 +WORKDIR /Octobot +COPY --from=build-env /Octobot/out . +ENTRYPOINT ["./TeamOctolings.Octobot"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..1f54508 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,23 @@ +services: + wireguard: + container_name: wireguard + image: jordanpotter/wireguard + cap_add: + - NET_ADMIN + - SYS_MODULE + sysctls: + net.ipv4.conf.all.src_valid_mark: 1 + volumes: + - /etc/wireguard/octobot.conf:/etc/wireguard/wg0.conf + restart: unless-stopped + + octobot: + build: + context: . + args: + - PUBLISH_OPTIONS + environment: + - BOT_TOKEN + network_mode: service:wireguard + depends_on: + - wireguard