Skip to content
Snippets Groups Projects
Verified Commit 97448bc8 authored by David Beniamine's avatar David Beniamine
Browse files

Compatibility between docker-compose and docker compose

parent 4bdce1b9
Branches
No related tags found
No related merge requests found
...@@ -53,12 +53,17 @@ usage() { ...@@ -53,12 +53,17 @@ usage() {
} }
if [ "$(is_docker)" -eq 1 ]; then if [ "$(is_docker)" -eq 1 ]; then
cmd="docker-compose exec $APP_SERVICE" if [ -z "$(which docker-compose)" ]; then
cmdmy="docker-compose exec $DB_SERVICE" compose="docker compose"
cmdmyInput="docker exec -i $(docker-compose ps -q $DB_SERVICE)" else
cmdrestart="docker-compose restart" compose="docker-compose"
cmdup="docker-compose up" fi
cmddown="docker-compose down" cmd="$compose exec $APP_SERVICE"
cmdmy="$compose exec $DB_SERVICE"
cmdmyInput="docker exec -i $($compose ps -q $DB_SERVICE)"
cmdrestart="$compose restart"
cmdup="$compose up"
cmddown="$compose down"
else else
cmdrestart="apache2ctl restart" cmdrestart="apache2ctl restart"
fi fi
...@@ -142,7 +147,7 @@ case $action in ...@@ -142,7 +147,7 @@ case $action in
;; ;;
"shell") "shell")
if [ $(is_docker) -eq 1 ]; then if [ $(is_docker) -eq 1 ]; then
docker cp doli_shell.php $(docker-compose ps -q $APP_SERVICE):/var/www docker cp doli_shell.php $($compose ps -q $APP_SERVICE):/var/www
fi fi
$cmd php -a -d auto_prepend_file=/var/www/doli_shell.php $cmd php -a -d auto_prepend_file=/var/www/doli_shell.php
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment