docker_compose_profiles.md

March 13, 2026 · View on GitHub

Docker Compose profiles in iam-proxy-italia

Profiles are a good way to optimize and extend a single Docker Compose file. The official docker manual says about profiles:

Profiles help you adjust your Compose application for different environments or use cases by selectively activating services. Services can be assigned to one or more profiles; unassigned services start by default, while assigned ones only start when their profile is active. This setup means specific services, like those for debugging or development, to be included in a single compose.yml file and activated only as needed.

In this Docker Compose project, profiles are used to limit startup to strictly necessary services. The services iam-proxy-italia and satosa-nginx do not have a profile and are started every time. All other services are started by selecting one or more of the following profiles:

Profile categories

  • storage_mongo – start MongoDB (session storage for OIDC and Wallet)
  • mongoexpress – start MongoDB and Mongo Express (web UI)
  • saml2 – SAML2-related services: Django SAML2 SP, SPID SAML checker
  • oidc – OIDC-related services: trust-anchor, CIE provider, relying-party demo (requires storage for backend)
  • wallet – enable MongoDB for Wallet (OpenID4VP / OpenID4VCI) backends
  • dev – development/test: SAML2 SP and SPID checker (same stack as saml2 for dev)
  • demo – start all demo services (storage, SAML2, OIDC, Wallet-related)

You can specify the required profile with --profile option in Docker Compose. Example with the demo profile to start all services:

docker compose --profile demo up

You can specify multiple profiles. Example with storage_mongo and saml2:

docker compose --profile storage_mongo --profile saml2 up

Using the environment variable:

COMPOSE_PROFILES=dev,storage_mongo docker compose up

The run-docker-compose.sh script can start selected profiles via its options.

Summary tables

Profile by service

ServiceProfiles
satosa-mongodemo, storage_mongo, mongoexpress, oidc, wallet
satosa-mongo-expressdemo, mongoexpress
relying-party-demo-mongodemo, storage_mongo, oidc
django_spdemo, dev, saml2
spid-samlcheckdemo, dev, saml2
trust-anchordemo, storage_mongo, oidc
cie-providerdemo, storage_mongo, oidc
relying-party-demodemo, storage_mongo, oidc
satosa-nginx(none – always on)
iam-proxy-italia(none – always on)

Services by profile

ProfileServices
(no profiles)satosa-nginx, iam-proxy-italia
storage_mongosatosa-mongo, satosa-nginx, iam-proxy-italia
mongoexpresssatosa-mongo, satosa-mongo-express, satosa-nginx, iam-proxy-italia
saml2django_sp, spid-samlcheck, satosa-nginx, iam-proxy-italia
oidcsatosa-mongo, trust-anchor, cie-provider, relying-party-demo-mongo, relying-party-demo, satosa-nginx, iam-proxy-italia
walletsatosa-mongo, satosa-nginx, iam-proxy-italia
devdjango_sp, spid-samlcheck, satosa-nginx, iam-proxy-italia
demoall of the above

Semantic grouping (SAML2 vs OIDC vs Wallet)

StackProfiles that include itServices
SAML2saml2, dev, demodjango_sp (djangosaml2), spid-samlcheck
OIDCoidc, demotrust-anchor, cie-provider, relying-party-demo-mongo (init), relying-party-demo, satosa-mongo (OIDC storage)
Walletwallet, demosatosa-mongo (OpenID4VP/OpenID4VCI storage); proxy runs in iam-proxy-italia
Storagestorage_mongo, mongoexpresssatosa-mongo, satosa-mongo-express

Profile by option in run-docker-compose.sh

OptionProfile
-pno profiles
-mstorage_mongo
-Mmongoexpress
-ddev
(none)demo

Insights