Welcome to mirror list, hosted at ThFree Co, Russian Federation.

010lamp « lamp « docker « build - github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cd02a215934a649c5c6d91b0038aac807ed47fc7 (plain)
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
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

source /usr/local/etc/library.sh # sets PHPVER

set -e

[[ "$1" == "stop" ]] && {
  echo "Stopping apache"
  apachectl graceful-stop
  echo "Stopping PHP-fpm"
  pkill -f php-fpm
  echo "Stopping mariaDB"
  mysqladmin -u root shutdown
  echo "LAMP cleanup complete"
  exit 0
}

# MOVE CONFIGS TO PERSISTENT VOLUME
persistent_cfg /etc/apache2/sites-available /data/etc/apache2/sites-available
persistent_cfg /etc/apache2/sites-enabled /data/etc/apache2/sites-enabled

# Run hardcoded hooks. This allows scripts in the image to change persistent values before
# initialization. Use case is to download a new image.
if [[ -f /usr/local/bin/ncp-docker-hook ]]; then
  source /usr/local/bin/ncp-docker-hook
fi

echo "Starting PHP-fpm"
php-fpm"${PHPVER}"

echo "Starting Apache"
/usr/sbin/apache2ctl start

# adjust the dbdir to the persistent storage
install_template "mysql/90-ncp.cnf.sh" "/etc/mysql/mariadb.conf.d/90-ncp.cnf" || exit 1

# start
echo "Starting mariaDB"
mysqld &

# wait for mariadb
while :; do
  [[ -S /run/mysqld/mysqld.sock ]] && break
  sleep 0.5
done
sleep 1

exit 0