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