From 046cad80728e538c2478accb2598ac1dc33f9d20 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 25 May 2023 10:25:11 +0200 Subject: [PATCH] Dockerfile for Tranga --- Dockerfile | 15 +++++++++++++++ Tranga-API/Dockerfile | 19 ------------------- Tranga-CLI/Dockerfile | 18 ------------------ 3 files changed, 15 insertions(+), 37 deletions(-) create mode 100644 Dockerfile delete mode 100644 Tranga-API/Dockerfile delete mode 100644 Tranga-CLI/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2dde678 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env +WORKDIR /src +COPY . /src/ +RUN ls /src +RUN dotnet restore Tranga-API/Tranga-API.csproj +RUN dotnet publish -c Release -o /publish + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 as runtime +WORKDIR /publish +COPY --from=build-env /publish . +RUN ls /publish +EXPOSE 80 +ENTRYPOINT ["dotnet", "/publish/Tranga-API.dll"] diff --git a/Tranga-API/Dockerfile b/Tranga-API/Dockerfile deleted file mode 100644 index dcd5b17..0000000 --- a/Tranga-API/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base -WORKDIR /app -EXPOSE 6531 - -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build -WORKDIR /src -COPY ["Tranga-API/Tranga-API.csproj", "Tranga-API/"] -RUN dotnet restore "Tranga-API/Tranga-API.csproj" -COPY . . -WORKDIR "/src/Tranga-API" -RUN dotnet build "Tranga-API.csproj" -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish "Tranga-API.csproj" -c Release -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Tranga-API.dll"] diff --git a/Tranga-CLI/Dockerfile b/Tranga-CLI/Dockerfile deleted file mode 100644 index 0d005f7..0000000 --- a/Tranga-CLI/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base -WORKDIR /app - -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build -WORKDIR /src -COPY ["Tranga-CLI/Tranga-CLI.csproj", "Tranga-CLI/"] -RUN dotnet restore "Tranga-CLI/Tranga-CLI.csproj" -COPY . . -WORKDIR "/src/Tranga-CLI" -RUN dotnet build "Tranga-CLI.csproj" -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish "Tranga-CLI.csproj" -c Release -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Tranga-CLI.dll"]