<reponame>jfleming3/TodoApi
FROM mcr.microsoft.com/dotnet/aspnet:3.1-focal AS base
WORKDIR /app
EXPOSE 5000

ENV ASPNETCORE_URLS=http://+:5000

# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

FROM mcr.microsoft.com/dotnet/sdk:3.1-focal AS build
WORKDIR /src
COPY ["/Users/justinfleming/.jenkins/workspace/test2/Repo1/TodoApi.csproj", "./"]
RUN dotnet restore "TodoApi.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "/Users/justinfleming/.jenkins/workspace/test2/Repo1/TodoApi.csproj" 

FROM build AS publish
RUN dotnet publish "/Users/justinfleming/.jenkins/workspace/test2/Repo1/TodoApi.csproj"  

FROM base AS final
WORKDIR /app
ENTRYPOINT ["dotnet", "TodoApi.dll"]
