Updated docker file to build and package the application and allowed Swagger page to be accessible in production mode
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
7f61374793
commit
a2a046aa71
@ -0,0 +1,27 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY . ./
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
#COPY ["/src/AdventOfCode/AdventOfCode.csproj", "AdventOfCode/"]
|
||||||
|
RUN dotnet restore "AdventOfCode.csproj"
|
||||||
|
#COPY ["AdventOfCode/", "AdventOfCode/."]
|
||||||
|
|
||||||
|
|
||||||
|
RUN dotnet build "AdventOfCode.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "./AdventOfCode.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
ENV ASPNETCORE_URLS=http://+:80
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "AdventOfCode.dll"]
|
Loading…
Reference in new issue