From addc0901f10db6e3ee526bd55c8658ddbe78e110 Mon Sep 17 00:00:00 2001 From: h7x4 <h7x4abk3g@protonmail.com> Date: Fri, 26 Mar 2021 23:41:22 +0100 Subject: [PATCH] Add docker file --- .dockerignore | 3 +++ Dockerfile | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..40b2902 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +bin +obj +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..204525f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build + +# build application +WORKDIR /src/Bot +COPY . . +RUN dotnet restore +RUN dotnet publish -c release -o /app --no-self-contained --no-restore + +# final stage/image +FROM mcr.microsoft.com/dotnet/runtime:5.0 + +WORKDIR /app +COPY --from=build /app . + +ENTRYPOINT ["./Bot"] \ No newline at end of file -- GitLab