first pass
This commit is contained in:
28
templates/dotnet/blazor/Dockerfile.template
Normal file
28
templates/dotnet/blazor/Dockerfile.template
Normal file
@@ -0,0 +1,28 @@
|
||||
# Stage 1: Build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:{{DOTNET_VERSION}} AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Copy project file and restore
|
||||
COPY ["{{CSPROJ_FILE}}", "./"]
|
||||
RUN dotnet restore "{{CSPROJ_FILE}}"
|
||||
|
||||
# Copy everything else and build
|
||||
COPY . .
|
||||
RUN dotnet build "{{CSPROJ_FILE}}" -c Release -o /app/build
|
||||
RUN dotnet publish "{{CSPROJ_FILE}}" -c Release -o /app/publish
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:{{DOTNET_VERSION}}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
# Set environment
|
||||
ENV ASPNETCORE_URLS=http://+:{{PORT}}
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
EXPOSE {{PORT}}
|
||||
|
||||
ENTRYPOINT ["dotnet", "{{DLL_NAME}}"]
|
||||
Reference in New Issue
Block a user