Improve dotnet templates (#16815)

* Add delivery api toggle

* Add Dockerfile

* add docker compose template

* Ensure no duplicate database containers

* Remove wwwroot/umbraco permission check

We don't need write access to this folder

* Provide environment variables from dokcer-compose

* Build as debug from compose

The compose file is intended to be used for local dev

* Don't store password in docker files

Still not great to store it in .env but it's fine for dev

* Add additional template files

* Add docker ignore file

* Enable delivery API in settings too

* Enable models builder mode toggle

* Add WIP for umbraco release option

* Add starterkit option

* Add option to chose LTS or latest

* Add development mode option

* Add descriptions

* Add display names

* Add backoffice development at explicit default

* Rearrange DevelopmentMode before ModelsBuilderMode

* Allow specifying a port for the compose file

* Add some notes

* Move starterkits into its own template

* Don't update version

* Remove test configuration from Dockerfile

* Add default modelsbuilder option

* Update descriptions

* overwrite default values in IDE development

* Remove obsolete runtime minification

* Try and fix healthcheck

* Don't use post action for starterkit

otherwise it won't work with Rider, also make the version 13.0.0 if LTS is chosen

* Move UmbracoVersion above FinalVersion

Otherwise, rider will use UmbracoVersion for some weird reason

* Fix healthcheck

* Use else instead of second if for modelsbuilder

* Obsolete UmbracoVersion

* Remove custom release option

* Use forward slashes for volumes

* Add MSSQL_SA_PASSWORD env variable

* Temporarily limit acceptance tests so it works

* Try again

* Disable SQLServer integration tests

* Set UseHttps to false in appsettings.Development.json

You still want to be able to use non-https when developing locally

* Fix LTS version

LTS still needs installer endpoints added

* Update permissions of wwwroot/umbraco for v13 sites

* Fix conditional in Program.cs

* Undo pipeline shenanigans
This commit is contained in:
Mole
2024-08-26 11:21:02 +02:00
committed by GitHub
parent 17d441760d
commit a31e4265bd
21 changed files with 620 additions and 14 deletions

View File

@@ -0,0 +1,33 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["UmbracoProject/UmbracoProject.csproj", "UmbracoProject/"]
RUN dotnet restore "UmbracoProject/UmbracoProject.csproj"
COPY . .
WORKDIR "/src/UmbracoProject"
RUN dotnet build "UmbracoProject.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "UmbracoProject.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# We need to make sure that the user running the app has write access to the umbraco folder, in order to write logs and other files.
# Since these are volumes they are created as root by the docker daemon.
USER root
RUN mkdir umbraco
RUN mkdir umbraco/Logs
RUN chown $APP_UID umbraco --recursive
#if (UmbracoRelease = 'LTS')
RUN chown $APP_UID wwwroot/umbraco --recursive
#endif
USER $APP_UID
ENTRYPOINT ["dotnet", "UmbracoProject.dll"]