- Proxmox → LXC container → Docker/Compose inside
- Runtipi:
v4.6.5, directory/opt/runtipi - Runtipi containers:
runtipi,runtipi-reverse-proxy,runtipi-queue,runtipi-db (postgres:14) - Goal: switch Runtipi to an external PostgreSQL (another LXC in the same network) and stop using
runtipi-db.
External PostgreSQL: 192.168.100.106:5432, database tipi, user tipi.
Password (hash) in files: de99…377b (not a secret, but masked in the text just in case).
The archive contains two “snapshots” of the system:
00_Initial_state/configs/
.env— original Runtipi env file. Key point:POSTGRES_HOST=runtipi-dbdocker-compose.yml— original compose file (with theruntipi-dbservice)
00_Initial_state/docker/
inspect_runtipi.json— output ofdocker inspect runtipiinspect_runtipi-db.json— output ofdocker inspect runtipi-dbdocker-compose.config.yml— output ofdocker compose config(effective configuration as seen by Compose)
00_Initial_state/logs/
runtipi.log—docker logs runtipiruntipi-db.log—docker logs runtipi-db
01_Attempt_external_PostgreSQL/configs/
.env.local— attempt to configure an external PostgreSQL:POSTGRES_HOST=192.168.100.106POSTGRES_PORT=5432POSTGRES_DBNAME=tipiPOSTGRES_USERNAME=tipiPOSTGRES_PASSWORD=de99…377b
.env— still containsPOSTGRES_HOST=runtipi-dbdocker-compose.yml— still includes theruntipi-dbservice (postgres:14)
01_Attempt_external_PostgreSQL/docker/
inspect_runtipi.json—docker inspect runtipiafter changesdocker-compose.config.yml—docker compose configafter changes (crucial for conclusions)
01_Attempt_external_PostgreSQL/logs/
runtipi.log—docker logs runtipiruntipi-db.log—docker logs runtipi-db
01_Attempt_external_PostgreSQL/command_outputs/
env_inside_container.txt— output ofenvinside theruntipicontainerruntipi-cli_status.txt— attempt to run./runtipi-cli status(“command not found” in this run)
01_Attempt_external_PostgreSQL/additional_checks_after_changes.txt
- output of
docker psand other verification commands after the changes
File: 01_.../command_outputs/env_inside_container.txt
It contains:
POSTGRES_HOST=192.168.100.106POSTGRES_PORT=5432POSTGRES_DBNAME=tipiPOSTGRES_USERNAME=tipiPOSTGRES_PASSWORD=...
This is also confirmed by:
File: 01_.../docker/inspect_runtipi.json → Config.Env contains POSTGRES_HOST=192.168.100.106.
➡️ So the external DB parameters do reach the container environment.
File: 01_.../docker/docker-compose.config.yml
It clearly shows:
depends_on: runtipi-dbPOSTGRES_HOST: runtipi-db
➡️ This means that docker compose config is not built from .env.local, but from the regular .env (or a generated environment), and still assumes PostgreSQL is a local service.
File: 01_.../additional_checks_after_changes.txt
docker ps shows:
runtipi-db postgres:14 ... Up ... (healthy)
Additionally, in 01_.../configs/docker-compose.yml, the runtipi-db: service is still present.
➡️ Even after attempts to “move the DB outside”, the local PostgreSQL container remains part of the stack and is started.
File: 01_.../docker/inspect_runtipi.json → Mounts
There is a bind mount:
Source: /opt/runtipi/.envDestination: /data/.env
And the file /opt/runtipi/.env (snapshot 01_.../configs/.env) contains:
POSTGRES_HOST=runtipi-db
In runtipi logs there is a line:
Generating system env file
➡️ This strongly suggests that Runtipi, on startup, generates/overwrites a “system env” based on /data/.env, i.e. based on the actual /opt/runtipi/.env, not on .env.local.
From the collected data, two facts hold at the same time:
- the
runtipicontainer does receivePOSTGRES_*variables pointing to the external host; - but the Runtipi / Compose stack remains tied to the local
runtipi-db, because:- the effective Compose configuration (
docker compose config) still containsPOSTGRES_HOST=runtipi-dbanddepends_on: runtipi-db; runtipimounts/opt/runtipi/.envas/data/.env, and that file still points toruntipi-db.
- the effective Compose configuration (
In other words, switching via .env.local looks insufficient / workaround-like. One of the following is likely required:
- modifying
/opt/runtipi/.envdirectly (the file that is actually used), - changing the startup / env-generation logic inside Runtipi,
- or fully removing the
runtipi-dbservice from the compose stack and checking whether the CLI / generator recreates it.
- What is the “canonical” way to configure an external PostgreSQL so that Runtipi does not regenerate env back to
runtipi-db? - Where is the single source of truth for DB configuration: container env vars,
/data/.env, somesystem.env, state file, or user config? - If
--env-fileis used, at which stage is it applied (CLI vs Docker Compose), and why doesdocker compose configstill resolve toruntipi-db?
01_.../docker/inspect_runtipi.json— mounts + env inside the container01_.../docker/docker-compose.config.yml— what Compose actually resolves (POSTGRES_HOST=runtipi-db)01_.../command_outputs/env_inside_container.txt— env inside the container (external IP visible)01_.../additional_checks_after_changes.txt—docker ps, showing thatruntipi-dbis still running01_.../configs/.envand.env.local— conflicting sources of truth