From ce9f5c57280383029c930f7faa03ad1a91bb5eb6 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Mon, 27 Mar 2023 03:27:34 +0300 Subject: [PATCH] dockerfile update --- src/api/NetworkResurrector.Api/Dockerfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/api/NetworkResurrector.Api/Dockerfile b/src/api/NetworkResurrector.Api/Dockerfile index fddb1a2..cab851b 100644 --- a/src/api/NetworkResurrector.Api/Dockerfile +++ b/src/api/NetworkResurrector.Api/Dockerfile @@ -1,23 +1,22 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build -WORKDIR /src +WORKDIR /buildspace COPY ["dependencies.props", "."] COPY ["Directory.Build.props", "."] COPY ["NuGet.config", "."] -COPY ["ReleaseNotes.xml", "."] -COPY ["src/api/NetworkResurrector.Api/NetworkResurrector.Api.csproj", "NetworkResurrector.Api/"] -COPY ["src/api/NetworkResurrector.Api.Application/NetworkResurrector.Api.Application.csproj", "NetworkResurrector.Api.Application/"] -COPY ["src/api/NetworkResurrector.Api.PublishedLanguage/NetworkResurrector.Api.PublishedLanguage.csproj", "NetworkResurrector.Api.PublishedLanguage/"] -COPY ["src/api/NetworkResurrector.Api.Domain/NetworkResurrector.Api.Domain.csproj", "NetworkResurrector.Api.Domain/"] -COPY ["src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj", "NetworkResurrector.Api.Domain.Data/"] -RUN dotnet restore "NetworkResurrector.Api/NetworkResurrector.Api.csproj" -COPY src/api . -WORKDIR "/src/NetworkResurrector.Api" +COPY ["src/api/NetworkResurrector.Api/NetworkResurrector.Api.csproj", "src/api/NetworkResurrector.Api/"] +COPY ["src/api/NetworkResurrector.Api.Application/NetworkResurrector.Api.Application.csproj", "src/api/NetworkResurrector.Api.Application/"] +COPY ["src/api/NetworkResurrector.Api.Domain/NetworkResurrector.Api.Domain.csproj", "src/api/NetworkResurrector.Api.Domain/"] +COPY ["src/api/NetworkResurrector.Api.PublishedLanguage/NetworkResurrector.Api.PublishedLanguage.csproj", "src/api/NetworkResurrector.Api.PublishedLanguage/"] +COPY ["src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj", "src/api/NetworkResurrector.Api.Domain.Data/"] +RUN dotnet restore "src/api/NetworkResurrector.Api/NetworkResurrector.Api.csproj" +COPY --exclude=src/agent --exclude=src/server . . +WORKDIR "/buildspace/src/api/NetworkResurrector.Api" RUN dotnet build "NetworkResurrector.Api.csproj" -c Release -o /app/build FROM build AS publish