generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes in Dockerfile of wikidata
- Loading branch information
Showing
1 changed file
with
11 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |