From 70cd740ce4af3de77587c1dd7e7d9377e9e64eb8 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Wed, 13 Mar 2024 23:32:40 +0100 Subject: [PATCH 1/3] Moving Dockerfile of folder --- wikidata_service/{WikiDataTest => }/Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename wikidata_service/{WikiDataTest => }/Dockerfile (100%) diff --git a/wikidata_service/WikiDataTest/Dockerfile b/wikidata_service/Dockerfile similarity index 100% rename from wikidata_service/WikiDataTest/Dockerfile rename to wikidata_service/Dockerfile From 9760dc87f50f970848294331dc873b8fcd933067 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Wed, 13 Mar 2024 23:38:28 +0100 Subject: [PATCH 2/3] Changing DockerFile again --- wikidata_service/Dockerfile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/wikidata_service/Dockerfile b/wikidata_service/Dockerfile index 8e01f1f..3958188 100644 --- a/wikidata_service/Dockerfile +++ b/wikidata_service/Dockerfile @@ -1,17 +1,22 @@ -# Use the official image as a parent image. -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app +EXPOSE 80 +EXPOSE 443 -# Copy csproj and restore as distinct layers -COPY *.csproj ./ -RUN dotnet restore +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 everything else and build -COPY . ./ -RUN dotnet publish -c Release -o out +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./WikiDataTest.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false -# Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:6.0 +FROM base AS final WORKDIR /app -COPY --from=build-env /app/out . +COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "WikiDataTest.dll"] \ No newline at end of file From 9aa364d7e97ea6edd737fdb8e56fd64e9d919970 Mon Sep 17 00:00:00 2001 From: sergiollende Date: Wed, 13 Mar 2024 23:40:42 +0100 Subject: [PATCH 3/3] Changing docker-compose --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 76c4b76..fc80d7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: wikidata_service: container_name: wikidata_service-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_en3a/wikidata_service:latest - build: ./wikidata_service/WikiDataTest + build: ./wikidata_service profiles: ["dev", "prod"] ports: - "7259:7259"