This file contains 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 base | |
WORKDIR /app | |
ARG project | |
COPY ./ . | |
RUN dotnet restore \ | |
&& dotnet build -c Release --no-restore | |
FROM base AS test | |
RUN dotnet test -c Release --no-build --logger trx |
This file contains 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
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | |
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | |
WORKDIR /src |
This file contains 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 base | |
WORKDIR /src | |
ENV NODE_VERSION 18.2.0 | |
ENV NODE_DOWNLOAD_SHA 73d3f98e96e098587c2154dcaa82a6469a510e89a4881663dc4c86985acf245e | |
ENV NODE_DOWNLOAD_URL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | |
RUN wget "$NODE_DOWNLOAD_URL" -O nodejs.tar.gz \ | |
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \ | |
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \ |
This file contains 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 base AS build | |
WORKDIR /app | |
ARG project | |
COPY ./ . | |
RUN dotnet restore | |
RUN dotnet build -c Release --no-restore |
This file contains 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 build AS test | |
RUN dotnet test -c Release --no-build --logger trx |
This file contains 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
# Known issue if multiple tests projects complete within the same time down to | |
# millisecond difference then the test file will not be uniquely named and will | |
# be overwritten by preceding files with the same name. | |
FROM scratch AS test-results | |
COPY --from=test /app/tests/**/TestResults/*.trx . |
This file contains 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 build as publish | |
RUN dotnet publish "./src/$project" -c Release --no-build -o /app/publish |
This file contains 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/aspnet:6.0 | |
WORKDIR /app | |
ENV APP_NAME "${project}.dll" | |
EXPOSE 80 | |
EXPOSE 443 | |
COPY --from=publish /app/publish . | |
ENTRYPOINT dotnet "$APP_NAME" |
This file contains 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 base | |
ENV NODE_VERSION 18.2.0 | |
ENV NODE_DOWNLOAD_SHA 73d3f98e96e098587c2154dcaa82a6469a510e89a4881663dc4c86985acf245e | |
ENV NODE_DOWNLOAD_URL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | |
RUN wget "$NODE_DOWNLOAD_URL" -O nodejs.tar.gz \ | |
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \ | |
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \ | |
&& rm nodejs.tar.gz \ |
This file contains 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
public static class Program | |
{ | |
public static int Main(string[] args) | |
{ | |
return new CakeHost() | |
.UseContext<BuildContext>() | |
.Run(args); | |
} | |
} |
OlderNewer