-
Notifications
You must be signed in to change notification settings - Fork 0
Adding a Stack
Osotechie edited this page Jun 22, 2026
·
1 revision
How to add a new Docker stack to the NAS.
Create a new folder at the repo root named after your stack:
my-new-stack/
├── docker-compose.yml
└── .env (optional — if you need secrets/variables)
Standard docker-compose.yml — nothing special required. Just follow these conventions:
-
Always set
container_name— makes logs and management clearer -
Always set
restart: always— containers should survive reboots -
Use
${VARIABLE}syntax in compose for values from.env - Use network assignments appropriate to the service (see below)
services:
my-app:
container_name: MyApp
hostname: myapp
image: author/my-app:latest
restart: always
networks:
IoT:
ipv4_address: 10.1.11.XX # If LAN-accessible
volumes:
- ${DOCKERDIR}/myapp:/config
labels:
# Traefik
- traefik.enable=true
- traefik.http.routers.myapp.rule=Host(`myapp.${DOMAIN}`)
- traefik.http.routers.myapp.entryPoints=websecure
# AutoKuma
- kuma.myapp.http.name=My App
- kuma.myapp.http.url=https://myapp.${DOMAIN}
- kuma.myapp.http.parent_name=my-new-stackIf your stack needs secrets (API keys, passwords, etc.):
- Add the secret to Azure KeyVault:
az keyvault secret set --vault-name <name> --name "myapp-api-key" --value "the-value" - Create a
.envfile in your stack directory with the token reference:MYAPP_API_KEY=#{MYAPP_API_KEY}#
- Reference it in your compose file:
${MYAPP_API_KEY}
See Adding a Secret for more detail.
| Scenario | Network | Notes |
|---|---|---|
| Needs direct LAN access |
IoT with static IP |
Pick an unused IP in 10.1.11.x
|
| Only accessed via Traefik | Stack-specific bridge | Traefik routes to it internally |
| Needs to talk to other stacks | Add shared network | e.g. media, monitor
|
git add my-new-stack/
git commit -m "Add my-new-stack"
git push origin mainThe deployment pipeline will automatically:
- Replace any
#{TOKEN}#values in your.env - Run
docker compose up -din your new stack directory - Sync the files to
/config/stacks/my-new-stackon the NAS
Check the GitHub Actions run, then verify on the NAS:
- Portainer should show the new containers
- AutoKuma should register any monitoring labels
- Traefik should pick up routing labels automatically
- Stack directory names are lowercase, hyphenated (e.g.
home-automation) - One
docker-compose.ymlper stack — don't nest further - Persistent data goes in
${DOCKERDIR}/container-name - Media/storage mounts use
${NAS_MEDIADIR}or direct/mnt/storagepaths
Overview
How-To