-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
38 lines (29 loc) · 1.06 KB
/
docker-entrypoint.sh
File metadata and controls
38 lines (29 loc) · 1.06 KB
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
38
#!/bin/bash
set -e
# put all docker environment
printenv >> /etc/environment
php /var/www/html/artisan storage:link
# xdebug
if [ ! -z "$XDEBUG_ENABLE" -a "$XDEBUG_ENABLE" != "false" -a "$XDEBUG_ENABLE" != "0" ] ; then
docker-php-ext-enable xdebug
fi
# 开启重写日志 @see https://httpd.apache.org/docs/current/mod/mod_rewrite.html
if [ ! -z "$REWRITE_TRACE_ENABLE" -a "$REWRITE_TRACE_ENABLE" != "false" -a "$REWRITE_TRACE_ENABLE" != "0" ] ; then
sed -i -E 's!#LogLevel info ssl:warn!LogLevel info rewrite:trace5!g' /etc/apache2/sites-enabled/000-default.conf
fi
if [ ! -z "$CRON_ENABLE" -a "$CRON_ENABLE" != "false" -a "$CRON_ENABLE" != "0" ] ; then
cron_etc="
[program:cron]
command=cron -f -L 15
stdout_logfile=/dev/stdout
stderr_logfile=/dev/stderr
stdout_maxbytes=0
stderr_maxbytes=0
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
autostart=true
autorestart=true"
echo "$cron_etc" >> /etc/supervisor/conf.d/supervisord.conf
crontab -u www-data /var/www/html/docker-crontab.conf
fi
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf