Skip to content

Commit

Permalink
Updated Docker Configuration. Related #70
Browse files Browse the repository at this point in the history
  • Loading branch information
eusonlito committed Oct 30, 2024
1 parent b924dfa commit aec7c18
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
15 changes: 12 additions & 3 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion docker/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion docker/stop.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit aec7c18

Please sign in to comment.