Docker volume mount (dbdata and appmedia) for persistent storage

I have AWS S3 folder mounted (s3fs) to my webODM VM. Though I could start my webODM with media-dir pointing to my S3 folder and store the appmedia data, I couldn’t migrate just with this appmedia data ALONE to a new webODM.

I wanted to have both dbdata and appmedia volume mounted externally and to have the data independent of webODM VM. That way, I could migrate the data to any webODM instance. Kindly let me know if anyone has done this?

I tried with this change (see the bold italicized below in docker-compose.yml) and didn’t work as it was hanging with “postgres initialization or couldn’t connect on some port (don’t recall the exact error as I terminated the VM)”

services:
db:
image: opendronemap/webodm_db
container_name: db
ports:
- “5432”
volumes:
- /external/s3:/var/lib/postgresql/data:Z
restart: unless-stopped
oom_score_adj: -100

webapp:
image: opendronemap/webodm_webapp
container_name: webapp
entrypoint: /bin/bash -c “chmod +x /webodm/*.sh && /bin/bash -c “/webodm/wait-for-postgres.sh db /webodm/wait-for-it.sh -t 0 broker:6379 – /webodm/start.sh””
volumes:
- /external/s3:/webodm/app/media:z

worker:
image: opendronemap/webodm_webapp
container_name: worker
entrypoint: /bin/bash -c “/webodm/wait-for-postgres.sh db /webodm/wait-for-it.sh -t 0 broker:6379 – /webodm/wait-for-it.sh -t 0 webapp:8000 – /webodm/worker.sh start”
volumes:
- /external/s3:/webodm/app/media:z