C
C#9mo ago
julian

❔ dotnet publish docker fails

This is my Dockerfile (It's in the root of the project)
# ---- 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 .NET project
COPY --from=build-vue /app/dist ./ClientApp/dist

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"]
# ---- 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 .NET project
COPY --from=build-vue /app/dist ./ClientApp/dist

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"]
Output:
No description
6 Replies
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
julian
julian9mo ago
It's a BitBucket project, so not public hehe But, I got to run my Domain project with Docker But I'm getting this error:
julian
julian9mo ago
No description
julian
julian9mo ago
How can I solve this?
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.