❔ Docker: Dotnet restore just loading
This is my Dockerfile.
It's installing all the node_modules and build is doing fine, but on
It's installing all the node_modules and build is doing fine, but on
dotnet restoredotnet restore, it's just loading. Why?# 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.
# ---- Vue.js Build Stage ----
FROM node:16-alpine AS build-vue
WORKDIR /app
# Copy package.json and yarn.lock for yarn install
COPY BFF/clientapp/package.json BFF/clientapp/yarn.lock ./
RUN yarn install
# Copy the rest of the Vue.js app and build it
COPY BFF/clientapp/ .
RUN yarn build
# .NET stages
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["BFF/BackendForFrontend.csproj", "BFF/"]
COPY ["Workcruit.Recruiter.WebClient.Grains/Workcruit.Recruiter.WebClient.Grains.csproj", "Workcruit.Recruiter.WebClient.Grains/"]
RUN dotnet restore "BFF/BackendForFrontend.csproj"
COPY . .
WORKDIR "/src/BFF"
# Copy the built Vue.js files to the appropriate directory in the .NET project
COPY --from=build-vue /app/dist ./wwwroot
RUN dotnet build "BackendForFrontend.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "BackendForFrontend.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BackendForFrontend.dll"]# 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.
# ---- Vue.js Build Stage ----
FROM node:16-alpine AS build-vue
WORKDIR /app
# Copy package.json and yarn.lock for yarn install
COPY BFF/clientapp/package.json BFF/clientapp/yarn.lock ./
RUN yarn install
# Copy the rest of the Vue.js app and build it
COPY BFF/clientapp/ .
RUN yarn build
# .NET stages
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["BFF/BackendForFrontend.csproj", "BFF/"]
COPY ["Workcruit.Recruiter.WebClient.Grains/Workcruit.Recruiter.WebClient.Grains.csproj", "Workcruit.Recruiter.WebClient.Grains/"]
RUN dotnet restore "BFF/BackendForFrontend.csproj"
COPY . .
WORKDIR "/src/BFF"
# Copy the built Vue.js files to the appropriate directory in the .NET project
COPY --from=build-vue /app/dist ./wwwroot
RUN dotnet build "BackendForFrontend.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "BackendForFrontend.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BackendForFrontend.dll"]