Skip to content

Instantly share code, notes, and snippets.

@eiximenis
Created November 2, 2017 00:42
Show Gist options
  • Save eiximenis/35536993081d00cd0fc9760c29637e49 to your computer and use it in GitHub Desktop.
Save eiximenis/35536993081d00cd0fc9760c29637e49 to your computer and use it in GitHub Desktop.
Create image with netcore2.0 + Nodejs (multi-stage build)
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80
FROM base as withnode
RUN apt-get update && apt-get install -my wget gnupg
RUN apt-get -qq update && apt-get -qqy --no-install-recommends install \
git \
unzip
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get install -y nodejs
FROM microsoft/aspnetcore-build:2.0 AS build
# Build your project here. Typically that means copying csproj file
# Performing a dotnet restore + build and left the result in a
# directory (i. e. /app)
FROM build AS publish
# Publish your project and left the result in one directory (i. e. /app)
FROM withnode AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "YourAmazingProject.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment