diff --git a/docker/build.sh b/docker/build.sh index 9102c59..00e362a 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -13,7 +13,16 @@ if [ ! -f .env ] && [ $(sudo docker ps -aq -f name=^passwordmanager$) != "" ]; t sudo sed -i 's/DB_HOST=mariadb/DB_HOST=passwordmanager-mariadb/' .env fi -cp -n docker/.env.example .env -cp -n docker/docker-compose.yml.example docker/docker-compose.yml +if [ ! -e .env ]; then + cp docker/.env.example .env +fi + +if [ ! -e docker/docker-compose.yml ]; then + cp docker/docker-compose.yml.example docker/docker-compose.yml +fi -sudo docker-compose -f docker/docker-compose.yml build +if docker compose version >/dev/null 2>&1; then + sudo docker compose -f docker/docker-compose.yml build +else + sudo docker-compose -f docker/docker-compose.yml build +fi diff --git a/docker/init.sh b/docker/init.sh index 0024a2b..94d6005 100755 --- a/docker/init.sh +++ b/docker/init.sh @@ -11,4 +11,6 @@ su -s /bin/bash -c './composer deploy-docker' www-data cron -su -s /bin/bash -c 'php artisan serve --host=0.0.0.0 --port=80' www-data +while true; do + su -s /bin/bash -c 'php artisan serve --host=0.0.0.0 --port=80 --no-reload' www-data +done diff --git a/docker/run.sh b/docker/run.sh index 459b8b5..eb13aca 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1,3 +1,7 @@ #!/bin/bash -sudo docker-compose -f docker/docker-compose.yml up -d +if docker compose version >/dev/null 2>&1; then + sudo docker compose -f docker/docker-compose.yml up -d +else + sudo docker-compose -f docker/docker-compose.yml up -d +fi diff --git a/docker/stop.sh b/docker/stop.sh old mode 100644 new mode 100755 index 4dc3e68..99fafa1 --- a/docker/stop.sh +++ b/docker/stop.sh @@ -1,3 +1,7 @@ #!/bin/bash -sudo docker-compose -f docker/docker-compose.yml stop +if docker compose version >/dev/null 2>&1; then + sudo docker compose -f docker/docker-compose.yml stop +else + sudo docker-compose -f docker/docker-compose.yml stop +fi