@@ -664,6 +664,40 @@ When executing commands on the remote VM, be aware of limitations with interacti
664664
665665This ensures that the command is executed and its output is returned to the primary terminal session.
666666
667+ # ### Docker Compose on Remote Servers
668+
669+ ** CRITICAL** : When working with Docker Compose on deployed servers, the environment file
670+ is NOT in the standard location. The Torrust Tracker Demo uses a persistent volume
671+ approach where all configuration files are stored in ` /var/lib/torrust` for backup
672+ and snapshot purposes.
673+
674+ ** Always use the ` --env-file` parameter** when running Docker Compose commands:
675+
676+ ` ` ` bash
677+ # Correct way to run Docker Compose commands on remote server
678+ ssh torrust@< VM_IP> " cd /home/torrust/github/torrust/torrust-tracker-demo/application && \
679+ docker compose --env-file /var/lib/torrust/compose/.env ps"
680+
681+ # Check service status
682+ ssh torrust@< VM_IP> " cd /home/torrust/github/torrust/torrust-tracker-demo/application && \
683+ docker compose --env-file /var/lib/torrust/compose/.env ps"
684+
685+ # View logs
686+ ssh torrust@< VM_IP> " cd /home/torrust/github/torrust/torrust-tracker-demo/application && \
687+ docker compose --env-file /var/lib/torrust/compose/.env logs tracker"
688+
689+ # Restart services
690+ ssh torrust@< VM_IP> " cd /home/torrust/github/torrust/torrust-tracker-demo/application && \
691+ docker compose --env-file /var/lib/torrust/compose/.env restart"
692+ ` ` `
693+
694+ ** Why this approach** :
695+
696+ - ** Persistent Volume** : All configuration stored in ` /var/lib/torrust` for persistence
697+ - ** Backup Strategy** : Snapshot only the volume instead of the entire server
698+ - ** Configuration Management** : Centralized environment variable management
699+ - ** Infrastructure Separation** : Configuration survives server recreation
700+
667701# ### Preferred Working Methodology
668702
669703** Work in Small Steps:**
0 commit comments