Umbraco running in Docker using https but BackOffi...
# help-with-umbraco
s
I am running Umbraco 12 in docker. I can access the published site using https. I can perform a members login with no issue. When I try and access /umbraco, I get a blank screen with a bunch of 404s in the java console for any items under /umbraco such as: * https://localhost:8443/umbraco/assets/css/umbraco.min.css?d=638354815950000000 * https://localhost:8443/umbraco/lib/font-awesome/css/font-awesome.min.css?d=638354815950000000 It seems any request for "files" under /umbraco fails. Everyone has been assigned full permissions of the top level folder. Read Only attributes have been removed. The issue does not occur when running the code using IIS Express locally. Any ideas on what I could have missed to be able to have the Backoffice rendering correctly? I've followed guides from Carl Sargunar and Jon D Jones but can't get past this issue. Any advice would be much appreciated.
s
I think most people's Docker experience is very limited, but obviously you're missing the static assets required for the backoffice to work. They should be in the output when you do a
dotnet publish
though (but I have no idea how to build a docker image). I'll gently ping @CarlCod_es as well since you mentioned him šŸ˜…
c
Hello
I’m rubbish at discord, sorry but I can try and help?
Do you have a repo I could take a look at?
a
Hi @Steve Adams I'm running my site in a docker too, but my DockerFile is nothing more then this:
Copy code
docker
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["ProjectName/ProjectName.csproj", "ProjectName/"]
COPY ["ProjectName.Business/ProjectName.Business.csproj", "ProjectName.Business/"]
COPY ["ProjectName.Data/ProjectName.Data.csproj", "ProjectName.Data/"]
RUN dotnet restore "ProjectName/ProjectName.csproj"
COPY . .
WORKDIR "/src/ProjectName"
RUN dotnet build "ProjectName.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "ProjectName.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ProjectName.dll"]
Basically, restore, build, publish, and throw the result in the docker, runs like a charm here. Hope this gives you some pointers
s
Thanks all for your replies. They gave me enough insights to get to the bottom of the problem. Turns out that running the docker orchestration inside of VS2022 was the root cause of my issue. Running the commands outside of VS2022 built the image and container correctly for me and I am now able to login to the Backoffice.
For anyone else struggling with getting it all running in Docker, please find my files below:
To create the ssl cert, I used the following commands: To clear my trusted dev certs:
dotnet dev-certs https --clean
To generate a new dv cert in my project's https folder:
dotnet dev-certs https -ep "https\project.pfx"  -p {replace with your own password}
To trust my cert:
dotnet dev-certs https --trust
Thanks for the offer Carl. I did resolve my problem. Ended up being related to me trying to run the orchestration via VS2022.
2 Views