Sharing the Docker Files and compose to run Umbraco 13+ into a Linux container with SSL
Hi,
I share with the community my docker file and docker compose to run Umbraco 13.
Sure it can be tweaked, but it works.
Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS base USER root
# Install cultures (same approach as Alpine SDK image) for ALPINE
# RUN apk add --no-cache icu-libs icu-data-full
#ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0 ENV DOTNET_RUNNING_IN_CONTAINER=true RUN apt-get update && apt-get install
-y libicu-dev WORKDIR /app EXPOSE 8080 EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["AgriPass360/AgriPass360.csproj", "AgriPass360/"] COPY ["AgriPass360Lib/AgriPass360Lib.csproj", "AgriPass360Lib/"] COPY ["AgriPass360PraticaModels/AgriPass360PraticaModels.csproj", "AgriPass360PraticaModels/"] RUN dotnet restore "AgriPass360/AgriPass360.csproj" COPY . . WORKDIR "/src/AgriPass360" RUN dotnet build "AgriPass360.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish ARG BUILD_CONFIGURATION=Release RUN dotnet publish "AgriPass360.csproj" -c $BUILD_CONFIGURATION -o /app/publish
FROM base AS final
#ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=0 RUN apt-get install -y libicu-dev
WORKDIR /app COPY --from=publish /app/publish . USER root RUN mkdir -p /app/umbraco/Data/TEMP RUN mkdir -p /app/umbraco/Data/TEMP/FileUploads RUN chown -R $APP_UID:$APP_UID /app RUN chmod o=rw /app/wwwroot/ RUN chmod o=rw /app/Views/ USER $APP_UID ENTRYPOINT ["dotnet", "AgriPass360.dll"]
I use the same structure—a Linux server with a docker application. But I couldn't figure out how to enable rewrite rules in web config. I thought I was going to install iis rewrite module but the scripts are not working This is my dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Umbraco.Web/Umbraco.Web.csproj", "Umbraco.Web/"]
RUN dotnet restore "Umbraco.Web/Umbraco.Web.csproj"
COPY . .
WORKDIR "/src/Umbraco.Web"
RUN dotnet build "Umbraco.Web.csproj" -c "$BUILD_CONFIGURATION" -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Umbraco.Web.csproj" -c "$BUILD_CONFIGURATION" -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Umbraco.Web.dll"]
Sharing the Docker Files and compose to run Umbraco 13+ into a Linux container with SSL
Hi,
I share with the community my docker file and docker compose to run Umbraco 13. Sure it can be tweaked, but it works.
Dockerfile:
docker-compose:
Hi Biagio,
I use the same structure—a Linux server with a docker application. But I couldn't figure out how to enable rewrite rules in web config. I thought I was going to install iis rewrite module but the scripts are not working This is my dockerfile:
Hi, the web.config is used by IIS and not under Linux. You have to check the container config file for the ingress rules: https://kubernetes.github.io/ingress-nginx/examples/rewrite/.
is working on a reply...