#!/usr/bin/env bash

echo "App Image Sidecar Container"
echo ""
echo "Copying application into shared volume."

# Todo, move over to rsync.
# todo: check target dir exists or error out.
# toto: use env var for source and target paths.
cp -R /app /www-data

#!/usr/bin/env bash

echo "App Image Sidecar Container"
echo ""
echo "Copying application into shared volume."
echo ""

echo "Rsync source is: ${RSYNC_SOURCE}/"
echo "Rsync destination is: ${RSYNC_DEST}/"

# Rsync to destination and preserve symlinks and file perms.
rsync -vah "${RSYNC_SOURCE}/" "${RSYNC_DEST}"

# Keep the container alive.
echo ""
echo "Finished sync job, keeping container alive..."
echo ""
php /root/noop.php

Update rsync script with env vars.
Update rsync script with env vars.
