From 007c5a720e40bb41e8617645fff5bab6f378aac7 Mon Sep 17 00:00:00 2001 From: Rafael Freitas Date: Mon, 30 Dec 2024 20:43:02 -0300 Subject: [PATCH] feat: add Dockerfile for building and running app --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..50b72f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env +WORKDIR /app + +COPY src/ . + +WORKDIR /MyRecipes.API/ + +RUN dotnet restore +RUN dotnet publish -c Relase -o /app/out + +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /app + +COPY --from=build-env/out /app/out . + +ENTRYPOINT [ "dotnet", "MyRecipes.API.dll" ] \ No newline at end of file