Main branch:
Dev Branch:
Climate data in Postgres and Umbraco12, hosted in Ubuntu Docker containers. The project can be run from Docker on either Windows, Mac, or Linux machines.
Contents:
- Ideal Umbrella π
- Docker
- CI/CD & Github Actions
- Development
- References & resources
The applications can be hosted in Docker. The documentation expects you have Docker Desktop installed.
Installs the following:
- Microsoft MSSQL Server with Umbraco database & user preconfigured
- Postgres SQL Server with preconfigured climate data tables
- Umbraco backoffice dotnet application
- Umbraco frontend dotnet application
If you're just looking around, run the following commands to quick-install the applications:
docker volume create ideal_umbrella_postgres_data
docker compose --env-file ./.env.example up --build
Note this uses credentials stored in git, do not use the .env.example
file for anything but local development. See Detail for full setup details
If you don't have the Docker platform installed, run through Install Docker Platform, then come back to this step.
- Create a volume for your postgres data to persist on
docker volume create ideal_umbrella_postgres_data
- Copy contents of
.env.example
into.env
- Adjust the values in
.env
these are secrets, do not commit them - Run the command to deploy the applications into docker containers
docker compose up --build
The first time you run docker compose
for the project, it will take a long time. The command will download MSSQL Server, Postgres, and Dotnet, then build the applications, then launch them.
You should be able to see the startup progress in Docker Desktop after a few minutes.
- Visit http://localhost:5010 for the backoffice or http://localhost:5011 for the front-end
To clear down the docker application & revert the installation
- Run the
down
command:
docker compose down --rmi local --volumes
- remove the persisted postgres volume
docker volume rm ideal_umbrella_postgres_data
Download and install Docker Desktop π. This will include all of Docker π in one package, and makes interacting with Docker much easier. This guide mostly uses terminal commands, but Docker Desktop will make the process simpler.
If you're using a first generation Apple Silicon Mac, you will need to configure Rosetta Emulation to get MSSQL server running:
- Open docker desktop
- Click the Settings cog in the top right
- In the General tab, make sure Use virtualization framework is set to
true
- Click Features in Development
- Set Use Rosetta for x86/amd64 emulation on Apple Silicon to
true
Containers check their health on startup. Some services depend on another service's healthcheck returning positive before starting up.
- Depends on no other container
The MSSQL container startup creates a database & user for the Umbraco applications. It will report Unhealthy until the Umbraco database & user is created.
- Depends on no other container
The Postgres container uses the built-in pg_isready
command to report its health.
- Depends on MSSQL/Healthy
The Umbraco Backoffice container will wait for the MsSQL container's healthy prompt before starting up.
It will report Unhealthy until a 200 is returned. On first launch, this will be after uSync has completed its import.
- Depends on MSSQL/Healthy & Umbraco Backoffice/Healthy
The Umbraco backoffice will wait for the Umbraco Backoffice container to report Healthy
Details below assume you've not changed the settings in .env.example
. You should change those settings & adjust the below accordingly
In Datagrip, setup the following to login:
Name
: example_postgres_sql_server_db@127.0.0.1Comment
: example_postgres_sql_server_db is a docker containerHost
: 127.0.0.1Port
: 5432Authentication
: User & PasswordUser
: POSTGRES_DB_CLIMATEDB_ADMIN_USERPassword
: POSTGRES_DB_CLIMATEDB_ADMIN_P@ssWORDDatabase
: POSTGRES_DB_CLIMATEDB
In SQL Server Management Studio setup the following to login:
Server Type
: Database EngineServer Name:
: localhost,1433Athentication
: SQL Server AuthenticationLogin
: saPassword
: YOUR_PASS_goes_HERE@
Optionally, click the Options button, then configure:
Connect to database
: EXAMPLE_UMBRACO_DATABASE_NAME
Server Type
: Database EngineServer Name:
: localhost,1433Athentication
: SQL Server AuthenticationLogin
: EXAMPLE_DATABASE_LOGIN_NAMEPassword
: EXAMPLE_DATABASE_LOGIN_P@ssword
Click the Options button, then configure:
Connect to database
: EXAMPLE_UMBRACO_DATABASE_NAME
The Umbraco application should be launched in localhost:
- Backoffice: http://localhost:5010/umbraco
- Frontend: http://localhost:5011/
In this example, configs are set in the .env
file. When pulling the repository initially, you'll need to copy .env.example
into .env
. You should change the values in .env
. Ideally these should be moved into Docker Secrets
PROJECT_FRIENDLY_NAME
is a friendly name for your project - it's used in Docker to name some containers and networks
POSTGRES_DATABASE_SERVER_AND_CONTAINER_NAME
, the login credential for your Posgres admin userPOSTGRES_DATABASE_DB
, the login credential for your Posgres admin userPOSTGRES_DATABASE_USER
, the login credential for your Posgres admin userPOSTGRES_DATABASE_PASSWORD
, the login credential for your Posgres admin user POSTGRES_DATABASE_DATA='/data/example-postgres-data'
UMBRACO_DATABASE_SERVER_SA_USERNAME
defualts tosa
UMBRACO_DATABASE_SERVER_SA_PASSWORD
Should be a string, and should confirm to Microsoft's SA password restrictions (at least 8 characters, with uppercase, lowercase, numbers and symbols)
UMBRACO_DATABASE_USERNAME_STRING
, your Umbraco database user's usernameUMBRACO_DATABASE_PASSWORD_STRING
, your Umbraco database user's password. Should confirm to Microsoft's database password restrictions (at least 8 characters, with uppercase, lowercase, numbers and symbols)
UMBRACO_DATABASE_SERVER_AND_CONTAINER_NAME
, this is the name of the container your database will live in. You'll sometimes use this value instead oflocalhost
when connecting to the database from inside of another docker containerUMBRACO_DATABASE_NAME
, this is your Umbraco database's name
These settings match the Umbraco Unattended Install π variables
UMBRACO_CMS_UNATTENDED_INSTALLUNATTENDED
, allows you to configure unattended installations. If this is set tofalse
, thewebsite-frontend
container won't startup until after you've run a manual installationUMBRACO_CMS_UNATTENDED_UNATTENDED_USERNAME
, the default user's username for an unattended installUMBRACO_CMS_UNATTENDED_UNATTENDED_EMAIL
, the default user's email for an unattended installUMBRACO_CMS_UNATTENDED_UNATTENDED_PASSWORD
, the default user's password for an unattended install
MAPBOX_FRONTEND_KEY
, your mapbox front-end key. It should beginpk
, and it should be configured to allow use on your domain. For localhost, you'll need to include the port number
Details of the github actions, and CI/CD process are below:
The site uses the Green Software Foundation's carbon aware API via Stebje's github action: https://github.com/stebje/jord. This will delay the build action if there is a greener time to run it in the near future.
Steps to launch the application(s) are detailed below:
To enable user secrets in dev, follow the guide: https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-7.0&tabs=windows#secret-manager
- Run
dotnet user-secrets init
to init the user secret feature in your dev env - Set secrets with
dotnet user-secrets set "json:path:to:your:secrete:key" "value"
dotnet user-secrets set "MapboxConfig:Settings:FrontEndKey" "your-mapbox-api-key-here"
- open a terminal
- change into the site's directory
cd .\IdealUmbrella.site\
- launch the site using
dotnet run
- Open the SLN file in
.\IdealUmbrella.site
- Press
F5
to launch
- The Umbraco Docker part of this project builds on Carl Sargunar's Umbraco Docker Workshop https://github.com/CarlSargunar/Umbraco-Docker-Workshop
- The application makes heavy use of Paul Seal's Clean Starter Kit https://our.umbraco.com/packages/starter-kits/clean-starter-kit/
- The application makes use of Jumoo's uSync