Skip to content

Instantly share code, notes, and snippets.

@guftall
Created May 14, 2019 08:56
Show Gist options
  • Save guftall/91baf9b8a63762dce099e6f6ea03bf7c to your computer and use it in GitHub Desktop.
Save guftall/91baf9b8a63762dce099e6f6ea03bf7c to your computer and use it in GitHub Desktop.
docker file for aspnetcore angular spa
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /app
COPY server.sln .
COPY ./Server/Server.csproj ./Server/
COPY ./Logger/Logger.csproj ./Logger/
COPY ./Server ./Server/
COPY ./Logger/. ./Logger/
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash \
&& . /root/.nvm/nvm.sh \
&& nvm install 10.15.0 \
&& nvm use 10.15.0 \
&& node -v \
&& dotnet build ./Server/Server.csproj \
&& dotnet build ./Logger/Logger.csproj
FROM build AS publish
WORKDIR /app
# COPY Server/AdminApp/assets ./Server/AdminApp/node_modules/bootstrap3-rtl/dist
RUN . /root/.nvm/nvm.sh \
&& nvm use 10.15.0 \
&& dotnet publish ./Server/Server.csproj -o /app/out
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS runtime
WORKDIR /app
COPY --from=publish /app/out ./
ENTRYPOINT ["dotnet", "Server.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment