-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathentrypoint.sh
More file actions
58 lines (50 loc) · 1.16 KB
/
entrypoint.sh
File metadata and controls
58 lines (50 loc) · 1.16 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#########################################################################
# START
# File Name: entrypoint.sh
# Author: Jetsung Chan
# Email: jetsungchan@gmail.com
# Created: 2019/09/02
# Updated: 2023/03/11
#########################################################################
set -e
set -u
set -o pipefail
install_tools() {
apt-get update -y
apt-get install -y gcc \
g++ \
autoconf \
automake \
make \
cmake
}
clear_tools() {
apt-get remove -y gcc \
g++ \
autoconf \
automake \
make \
cmake
apt-get autoremove -y
apt-get autoclean -y
apt-get clean -y
}
# Add PHP Extension
install_extensions() {
if [ -f "/app/extension.sh" ] && [ ! -f /app/.installed ]; then
pushd /app >/dev/null || exit
install_tools
bash extension.sh
date "+%F %T" >>/app/.installed
#clear_tools
popd >/dev/null || exit
fi
}
if [[ "${1}" = "-D" ]]; then
install_extensions 2>&1 | tee ./install.log
# start supervisord and services
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
else
exec "$@"
fi