Here's an example of my setup (actually, I have scripts more than just ll
)
.ddev/docker-compose.env.yaml
version: '3.6'
services:
web:
environment:
- PROD_USER=foo
- PROD_SERVER=bar.com
- PROD_ROOT=path/to/root
- LOCAL_ROOT=that/path/to/root
- ASSET_DIRS=bi ba bu
.ddev/commands/web/sync_down_files
#!/bin/bash
# rsync prod assets to local
# download all assets
for directory in ${ASSET_DIRS} ; do
rsync -zra \
--delete \
--exclude='.env' \
${PROD_USER}@${PROD_SERVER}:/home/${PROD_USER}/${PROD_ROOT}/$directory \
${LOCAL_ROOT};
done
Now I do ddev sync_down_files
and get all remote assets into the local site. Same for the db.