From 8eedb1c7ac0b4b5e81be8ec6e0a61cfdf995659b Mon Sep 17 00:00:00 2001 From: Antoine Cailliau Date: Wed, 31 May 2023 21:32:50 +0200 Subject: [PATCH] Updates Dockerfile for WebApp --- .github/workflows/docker-image.yml | 2 ++ DocIntel.WebApp/Dockerfile | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index dd1a1e15..a197aa7e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,6 +16,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 + with: + submodules: recursive - name: Login to Docker Hub uses: docker/login-action@v2 diff --git a/DocIntel.WebApp/Dockerfile b/DocIntel.WebApp/Dockerfile index 13212d68..bce9b480 100644 --- a/DocIntel.WebApp/Dockerfile +++ b/DocIntel.WebApp/Dockerfile @@ -8,21 +8,33 @@ EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src + +# Copying Library COPY ["./Library", "./Library"] + +# Copying dependencies +RUN mkdir -p ./synsharp/Synsharp.Telepath/ +COPY ["./synsharp/Synsharp.Telepath/Synsharp.Telepath.csproj", "./synsharp/Synsharp.Telepath/"] +COPY ["./DocIntel.Services.Scraper/DocIntel.Services.Scraper.csproj", "./DocIntel.Services.Scraper/"] COPY ["./DocIntel.Core/DocIntel.Core.csproj", "./DocIntel.Core/"] -COPY ["./DocIntel.Integrations/DocIntel.Integrations.csproj", "./DocIntel.Integrations/"] + COPY ["./DocIntel.WebApp/DocIntel.WebApp.csproj", "./DocIntel.WebApp/"] COPY ["./DocIntel.AdminConsole/DocIntel.AdminConsole.csproj", "./DocIntel.AdminConsole/"] COPY ["./DocIntel.WebApp/package.json", "./DocIntel.WebApp/"] + +# Install nodeJs 16 RUN apt-get update && apt-get install curl build-essential autoconf libpng-dev python2 -y --no-install-recommends RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get update && apt-get install -y nodejs -# RUN npm install --global yarn + +# Let's restore WORKDIR /src/DocIntel.WebApp/ RUN npm install WORKDIR /src RUN dotnet restore "./DocIntel.WebApp/DocIntel.WebApp.csproj" RUN dotnet restore "./DocIntel.AdminConsole/DocIntel.AdminConsole.csproj" + +# Let's build COPY . . WORKDIR /src/DocIntel.WebApp RUN dotnet build "DocIntel.WebApp.csproj" -c Release -o /app/build