-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart-container.sh
More file actions
37 lines (28 loc) · 944 Bytes
/
start-container.sh
File metadata and controls
37 lines (28 loc) · 944 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
33
34
35
36
37
#!/usr/bin/env bash
if [ ! "production" == "$APP_ENV" ] && [ ! "prod" == "$APP_ENV" ]; then
# Enable xdebug
## FPM
ln -sf /etc/php/"$PHP_VERSION"/mods-available/xdebug.ini /etc/php/"$PHP_VERSION"/fpm/conf.d/20-xdebug.ini
## CLI
ln -sf /etc/php/"$PHP_VERSION"/mods-available/xdebug.ini /etc/php/"$PHP_VERSION"/cli/conf.d/20-xdebug.ini
else
# Disable xdebug
## FPM
if [ -e /etc/php/"$PHP_VERSION"/fpm/conf.d/20-xdebug.ini ]; then
rm -f /etc/php/"$PHP_VERSION"/fpm/conf.d/20-xdebug.ini
fi
## CLI
if [ -e /etc/php/"$PHP_VERSION"/cli/conf.d/20-xdebug.ini ]; then
rm -f /etc/php/"$PHP_VERSION"/cli/conf.d/20-xdebug.ini
fi
fi
sed -i "s/xdebug\.remote_host\=.*/xdebug\.remote_host\=$XDEBUG_HOST/g" /etc/php/7.2/mods-available/xdebug.ini
if [ ! -d /.composer ]; then
mkdir /.composer
fi
chmod -R ugo+rw /.composer
if [ $# -gt 0 ]; then
exec "$@"
else
/usr/bin/supervisord
fi