Working with Umbraco in Web Containers
Deploying a Umbraco web application is super easy with the .NET Core + SDK Container images. We designed these to concentrate and simplify your application configuration in a single Container. This document follows a similar flow to the article on deploying .NET Core Containers.
This guide will take you through the process of setting up a .NET Core + SDK Web Container and then customizing it to run a website based on the Umbraco CMS. You can follow these steps in your local environment, or use SSH access to follow them on the Webslice Containers.
Create and Build Your App
Install Umbraco on your local machine:
Create a new project:
Before deploying your app on your Container, there are three tweaks to make.
- Edit the
launchSettings.json
file in order to allow your project to listen on port 80. - Update the
applicationUrl
key underiisSettings
group, so it looks like the following example. - Remove the value on the
applicationUrl
key under theUmbraco.Web.UI
group.
You’re now ready to publish the project. Update the project folder name and location in this example:
Deploy Your Project
Now you can move the output of the publish command to the application directory, which should be in the /container/application/
folder.
Once that’s updated, you need to make a small change to the supervisord.conf
file (which is located in `/container/config). Replace the name of the dll file with the one you choose when creating the project:
As with all configuration changes, you’ll need to reboot the Container for this to take effect.
Redirect to HTTPS
Most of the work that needs to be done is already covered by our SSL documentation, under the heading “How to Enforce HTTPS on a Web Container“. All of the method calls will need to be made before app.UseUmbraco()
. There are a couple of other Umbraco-specific changes to make.
We’ll need to edit the applicationUrl
for iisSettings
to use https://
instead of http://
.
The only other change you’ll need is to tell Umbraco to use HTTPS in appSettings.json
. This will change all of Umbraco’s URLs to use HTTPS instead of HTTP.
Example Project
On GitHub you can find our example Umbraco repo. You can use this as a guide to creating your own project, or as a template.