Skip to content

Commit

Permalink
Deployment fixes
Browse files Browse the repository at this point in the history
Changes in Dockerfile of wikidata
  • Loading branch information
UO289930 authored Mar 13, 2024
2 parents 13137f1 + 9a36311 commit 84f26ae
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions wikidata_service/WikiDataTest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
# Use the official image as a parent image.
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
EXPOSE 7259

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["WikiDataTest/WikiDataTest.csproj", "WikiDataTest/"]
RUN dotnet restore "./WikiDataTest/./WikiDataTest.csproj"
COPY . .
WORKDIR "/src/WikiDataTest"
RUN dotnet build "./WikiDataTest.csproj" -c %BUILD_CONFIGURATION% -o /app/build
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./WikiDataTest.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

FROM base AS final
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=publish /app/publish .
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "WikiDataTest.dll"]

0 comments on commit 84f26ae

Please sign in to comment.