Last active
December 15, 2022 00:55
-
-
Save gistlyn/7762f388b8dad04be48128e2f93d0e7a to your computer and use it in GitHub Desktop.
dotnet-build-node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | |
WORKDIR /app | |
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ | |
&& apt-get install -y --no-install-recommends nodejs \ | |
&& echo "node version: $(node --version)" \ | |
&& echo "npm version: $(npm --version)" \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY MyApp/package.json . | |
COPY MyApp/npm-shrinkwrap.json . | |
RUN npm --prefix MyApp install | |
COPY . . | |
RUN dotnet restore | |
WORKDIR /app/MyApp | |
RUN dotnet publish -c release -o /out --no-restore | |
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime | |
WORKDIR /app | |
COPY --from=build /out ./ | |
ENTRYPOINT ["dotnet", "MyApp.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment