forked from mathieuruellan/docker-piwigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
29 lines (20 loc) · 828 Bytes
/
entrypoint.sh
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
#!/bin/bash
for d in $(ls /template); do
[ "$(ls -A /var/www/${d})" ] || cp -R /template/${d}/* /var/www/${d}/
done
mkdir -pv /config/php/apache2.d
find /config/php/apache2.d -type f | while read file; do
ln -svf "${file}" "/etc/php/7.0/apache2/conf.d/$(basename "${file}")";
done;
sed -i "s/\/var\/www\/html/\/var\/www/g" /etc/apache2/sites-enabled/000-default.conf
sed -i '/^\s*DocumentRoot.*/a \\tSetEnv HTTPS on' /etc/apache2/sites-enabled/000-default.conf
sed -i 'ServerName piwigo.onrender.com' /etc/apache2/apache2.conf
systemctl restart apache2
chown -R www-data:www-data /var/www
if [ ! -z "${PIWIGO_MYSQL_ENGINE}" ]; then
grep -Rn MyISAM /var/www/install | cut -d: -f1 | sort -u | while read file; do
sed -i 's/MyISAM/InnoDB/' "${file}";
done;
fi;
source /etc/apache2/envvars
apache2ctl -D FOREGROUND