-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
32 lines (26 loc) · 929 Bytes
/
docker-entrypoint.sh
File metadata and controls
32 lines (26 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# Only run these commands if we're starting Apache
if [ "$1" = 'apache2-foreground' ]; then
echo "Running initial setup..."
# Check if composer.json exists and run composer install
if [ -f "composer.json" ]; then
echo "Installing PHP dependencies..."
composer install --no-interaction --optimize-autoloader
fi
# Check if package.json exists and run npm install
if [ -f "package.json" ]; then
echo "Installing Node.js dependencies..."
npm install --omit=optional --ignore-scripts
# Run grunt build if available
if [ -f "Gruntfile.js" ] || [ -f "gruntfile.js" ]; then
echo "Running grunt build..."
grunt build
else
echo "No Gruntfile found, skipping grunt build."
fi
fi
echo "Setup complete, starting Apache..."
fi
# Execute the passed command
exec "$@"