Skip to content

Commit

Permalink
perf: drop supervisor. use custom init
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschubek committed Nov 24, 2024
1 parent 5bb93c4 commit 9a4f653
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 36 deletions.
35 changes: 0 additions & 35 deletions server/supervisor/supervisord.conf

This file was deleted.

34 changes: 33 additions & 1 deletion src/init.sh
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
utpp "/etc/nginx/**;/etc/supervisor/**;/usr/local/etc/php*/**;/var/www/html/*.php" && /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
#!/bin/bash
# echo colors
CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
GREEN_BG_BLACK_TEXT='\033[42;30m'
NC='\033[0m' # reset

dbv=$DIRBROWSER_VERSION
echo -e "${GREEN_BG_BLACK_TEXT} dir-browser v${dbv} by Adrian Schubek${NC}"
echo -e "${CYAN} -> https://dir.adriansoftware.de <- ${NC}"

echo -e "${YELLOW}[ 1/6 ] Pre-processing configs using utpp... ${NC}"
utpp "/etc/nginx/**;/usr/local/etc/php*/**;/var/www/html/*.php"

echo -e "${YELLOW}[ 2/6 ] Starting php-fpm... ${NC}"
php-fpm -RF &

echo -e "${YELLOW}[ 3/6 ] Starting worker... ${NC}"
php /var/www/html/worker.php &

echo -e "${YELLOW}[ 4/6 ] Starting nginx... ${NC}"
nginx -g 'daemon off;' &

echo -e "${YELLOW}[ 5/6 ] Starting redis... ${NC}"
redis-server /etc/redis.conf --save 60 1 &

echo -e "${GREEN}[ 6/6 ] All services running!${NC}"
wait -n

echo -e "${RED}Error: Terminating due to a service exiting...${NC}"
exit $?

0 comments on commit 9a4f653

Please sign in to comment.