Customize app config
Overview
In this guide, we'll show you how to customize the configuration of an app by overriding the default docker-compose.yml
and app.env
files.
Example use cases
- Set
Pihole
to listen on a custom IP address - Mount an existing volume on your host into a media app such as
Jellyfin
. By default, media apps will only be able to see files withinruntipi/media
, but you can add other volumes.
An alternative approach to mounting a volume into an app would be to symlink your host volume into runtipi/media
. However, that would make it visible to all apps that mount the media
folder, which may not be desirable.
Create custom docker config
In this example we're going to add environment variables to the Pihole
app and mount the /cellar
volume into the Jellyfin
app.
To determine how to set environment variables to customize the Pihole
container, we look at runtipi/apps/pihole/docker-compose.yml
:
ports:
- ${NETWORK_INTERFACE:-0.0.0.0}:53:53/tcp
- ${NETWORK_INTERFACE:-0.0.0.0}:53:53/udp
- ${NETWORK_INTERFACE:-0.0.0.0}:${APP_PORT}:80
From this, we know that we need to set the NETWORK_INTERFACE
variable.
Don't edit the files in the apps
folder directly; they will be overwritten on update.
- Create
user-config
folder withinruntipi
and a folder for each app:
cd runtipi
mkdir user-config
mkdir user-config/jellyfin
mkdir user-config/pihole
- Create a
docker-compose.yml
forjellyfin
and add this content:
touch user-config/jellyfin/docker-compose.yml
nano user-config/jellyfin/docker-compose.yml
version: "3.7"
services:
jellyfin:
volumes:
- /cellar:/cellar
Replace /cellar
with the volume you want to mount.
- Create an
app.env
forpihole
and add this content:
touch user-config/pihole/app.env
nano user-config/pihole/app.env
NETWORK_INTERFACE=10.20.0.53
Replace 10.20.0.53
with the IP address you want pihole to listen on.
- You should end up with a structure like this:
- Restart the apps and test:
./scripts/app.sh stop jellyfin
./scripts/app.sh stop pihole
./scripts/app.sh start jellyfin
./scripts/app.sh start pihole
- Test Jellyfin by opening the app and configuring a library. You should now see your mounted volume.
- Test Pihole with a DNS query to the new IP address:
nslookup google.com 10.20.0.53
Server: 10.20.0.53
Address: 10.20.0.53#53
Non-authoritative answer:
Name: google.com
Address: 142.250.200.46
Name: google.com
Address: 2a00:1450:4009:822::200e