Skip to content

Commit c333c43

Browse files
committed
Support for DELAY_START - delay installing packages and starting services
1 parent 097a81f commit c333c43

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

init-scripts/container.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ if [ -f "/root/.ssh/id_rsa.pub" ] ;
1111
then
1212
cp /root/.ssh/id_rsa.pub /var/local/id_rsa.pub
1313
chown www-data /var/local/id_rsa.pub
14-
fi
14+
fi
15+
16+
### Create Xdebug log file
17+
mkdir -p /var/log/xdebug
18+
touch /var/log/xdebug/remote.log && chmod 777 /var/log/xdebug/remote.log
1519

1620
### Set web server root folder according to env variable ###
1721

@@ -76,6 +80,12 @@ IFS=$SAVEIFS
7680
### Run composer install & app bootstrap scripts ###
7781
cd /var/www
7882

83+
# Check for delay start
84+
if [ -z ${DELAY_START+x} ]; then true; else
85+
echo "Delaying container start for ${DELAY_START} ...";
86+
sleep ${DELAY_START};
87+
fi
88+
7989
# Copy env file
8090

8191
if [ ! -f "/var/www/.env" ]; then
@@ -85,10 +95,6 @@ if [ ! -f "/var/www/.env" ]; then
8595

8696
fi
8797

88-
# Create Xdebug log file
89-
mkdir -p /var/log/xdebug
90-
touch /var/log/xdebug/remote.log && chmod 777 /var/log/xdebug/remote.log
91-
9298
# Run composer install
9399
if [ -f "/var/www/composer.json" ] ;
94100
then

0 commit comments

Comments
 (0)