GreenStack Starter Dockerfile Print

  • 0

You will need to add the below Dockerfile to your project, we have pre-configured this for our GreenStack platform.

If you customise the file, please leave the port and workdirs as provided, these paths are what our system needs to allow your website to run.

You will need to change the UmbracoProject.Web to match your project name and path.

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 8080

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY . ./
RUN dotnet restore "UmbracoProject.Web.csproj" --use-lock-file
COPY . .
RUN dotnet build "UmbracoProject.Web.csproj" -c  $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
RUN dotnet publish "UmbracoProject.Web.csproj" -c  $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "UmbracoProject.Web.dll"]

Was this answer helpful?

« Back