-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·19 lines (13 loc) · 643 Bytes
/
setup.sh
File metadata and controls
executable file
·19 lines (13 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
set -euo pipefail
# This script now executes the setup process inside the running Docker container
# to ensure the correct PHP environment is used.
# The service name of the PHP container in docker-compose.yml
SERVICE_NAME="php-app"
# The path to the PHP setup script inside the container
# The 'app' directory is mounted at /var/www/html
SCRIPT_PATH="/var/www/html/scripts/setup.php"
echo "Executing setup script inside the '$SERVICE_NAME' container..."
# Use docker-compose to execute the PHP script in the correct container
docker-compose exec "$SERVICE_NAME" php "$SCRIPT_PATH" "$@"
echo "Setup script finished."