I took x new vue-nuxt for a spin and I have to say I LOVE it! Exactly what we were looking for!
Now, the problem. Since I’m not well versed in Dockerfile, I can’t quite figure out how to get both a dotnet and node build going at the same time. We do this because we want to deploy to AWS ECS but I can’t get past this part.
Since the Dockerfile provided by Visual Studio only provide dotnet instructions, we getting stopped by this code in the proj file
<Target Name="OnFirstUse" BeforeTargets="Build" Condition=" !Exists('wwwroot\dist') ">
<Exec Command="node --version" ContinueOnError="true"><Output TaskParameter="ExitCode" PropertyName="ErrorCode" /></Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
We’re SO close…
Dockerfile looks like
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
COPY ["VueNuxtApp1/VueNuxtApp1.csproj", "VueNuxtApp1/"]
COPY ["VueNuxtApp1.ServiceInterface/VueNuxtApp1.ServiceInterface.csproj", "VueNuxtApp1.ServiceInterface/"]
COPY ["VueNuxtApp1.ServiceModel/VueNuxtApp1.ServiceModel.csproj", "VueNuxtApp1.ServiceModel/"]
RUN dotnet restore "VueNuxtApp1/VueNuxtApp1.csproj"
COPY . .
RUN dotnet build "VueNuxtApp1.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "VueNuxtApp1.csproj" -c Release -o /app/publish
FROM base AS final
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "VueNuxtApp1.dll"]
Which again, would normally work, but in this project case, we also need Node.