This commit is contained in:
nmaillat
2025-05-21 00:47:16 +02:00
parent eca8706c97
commit 388f7290cd
3 changed files with 8 additions and 10 deletions

View File

@@ -205,17 +205,20 @@ If you are not interested in the development of Phraseanet, you can ignore every
### stack Management ### stack Management
To start and stop the stack, use the `stack_management.sh start|stop|info|check|log` script at the project root.
To start and stop the stack, use the `stack_management.sh start|stop|info|status|log` script at the project root.
this script work only Linux and MacOS. this script work only Linux and MacOS.
This script wrapping standard oprations for the stack, using standard docker compose cmd and take in account `.env` and `env.local | .env.local` files. This script wrapping standard oprations for the stack, using standard docker compose cmd and take in account `.env` and `env.local | .env.local` files.
The `stop` operation is the most critical function of the script, as it ensures a clean shutdown The `stop` operation is the most critical function of the script, as it ensures a clean shutdown
of the database container before stopping the entire stack. of the database container before stopping the entire stack.
This script is useful if you are using the database container within the stack. This script is useful if you are using the database container within the stack.
see more here ![stack Management](doc/infra/compose/stack_management.md) see more here ![stack](doc/infra/compose/stack.md)
### Using a env.local method for custom .env values ### Using a env.local method for custom .env values

11
stack_management.sh → stack.sh Executable file → Normal file
View File

@@ -42,11 +42,6 @@ check_versions() {
echo "Docker and Docker Compose versions are compatible." echo "Docker and Docker Compose versions are compatible."
# Get uptime of the stack
echo "Stack Uptime:"
$DOCKER_COMPSE_CMD ps | awk 'NR>1 {print $4}'
echo
# Get internal IP addresses # Get internal IP addresses
echo "Internal IP Addresses:" echo "Internal IP Addresses:"
$DOCKER_COMPSE_CMD exec -T db sh -c 'ip addr show eth0 | grep "inet " | awk "{print \$2}" | cut -d/ -f1' $DOCKER_COMPSE_CMD exec -T db sh -c 'ip addr show eth0 | grep "inet " | awk "{print \$2}" | cut -d/ -f1'
@@ -200,17 +195,17 @@ case "$1" in
stop) stop)
stop_stack stop_stack
;; ;;
check) status)
check_versions check_versions
;; ;;
info) info)
display_info display_info
;; ;;
log) logs)
display_logs "$2" display_logs "$2"
;; ;;
*) *)
echo "Usage: $0 {start|stop|check|info|log [container_name]}" echo "Usage: $0 {start|stop|status|info|logs [container_name]}"
exit 1 exit 1
esac esac