-
-
Save dantleech/a2520e618640b3d1158215e6aa13ef95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run a command in the app container as the www-data user | |
ARGS="$@" | |
docker exec --user=www-data --tty=true `docker-compose ps -q app` $ARGS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sync all changes to the app container | |
while RES=$(inotifywait -r -e close_write ./ --format %w%f) | |
do | |
echo 'FILE: '$RES | |
rsync \ | |
-azrlptDv \ | |
--chown=www-data:www-data \ | |
--force \ | |
--blocking-io \ | |
--progress \ | |
--relative \ | |
--exclude=4913 \ | |
-e "docker exec -i "`docker-compose ps -q app` \ | |
./$RES \ | |
env:/app | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment