forked from zendtech/php-zendserver-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.__2019.0-apache
60 lines (54 loc) · 3.06 KB
/
Dockerfile.__2019.0-apache
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
59
60
FROM ubuntu:bionic
EXPOSE 80 443 10081 10082
RUN apt-get update && \
apt-get -y install curl wget sqlite3 nano net-tools gnupg adduser && \
rm -rf /var/lib/apt/lists/*
COPY ZS /root/files/
RUN set -eu; \
export GNUPGHOME="$(mktemp -d)"; \
key='799058698E65316A2E7A4FF42EAE1437F7D2C623'; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
gpg --batch --armor --export "$key" > /etc/apt/trusted.gpg.d/zend-infra.gpg.asc; \
rm -rf "$GNUPGHOME"; \
echo "deb http://repos.zend.com/zend-server/2019.0.5/deb_ssl1.1 server non-free" > /etc/apt/sources.list.d/zend.list; \
apt-get update && apt-get -y install zend-server-apache-fpm zend-server-common && rm -rf /var/lib/apt/lists/*; \
a2enmod ssl && a2ensite default-ssl; \
rm -f /root/files/default_nginx_ssl.conf; \
/usr/local/zend/bin/zendctl.sh stop
# a separate layer for the intialization
# the WebAPI key is temporary, it is being replaced during container startup
RUN /usr/local/zend/bin/zendctl.sh start; \
/usr/local/zend/bin/zs-manage api-keys-add-key -n docker -s abfcf1870171fd206240f2e2b5291105c204d5aa65ef57d3fc4fa1ec06bfb445; \
/usr/local/zend/bin/zs-manage bootstrap-single-server -p DUMMY_PASSWORD -a 'TRUE' -t 3 -w 5; \
/usr/local/zend/bin/zs-manage restart -N docker -K abfcf1870171fd206240f2e2b5291105c204d5aa65ef57d3fc4fa1ec06bfb445; \
/usr/local/zend/bin/zendctl.sh stop
# yet another layer for cleanup and cluster preparation
RUN sqlite3 /usr/local/zend/var/db/zsd.db \
"delete from ZSD_DIRECTIVES; \
delete from ZSD_EXTENSIONS; \
delete from ZSD_PHP_EXTENSIONS; \
delete from ZSD_PHP_EXTENSIONS_DIRECTIVES; \
delete from ZSD_ZEND_COMMON_DIRECTIVES; \
delete from ZSD_ZEND_DAEMONS_DIRECTIVES; \
delete from ZSD_ZEND_EXTENSIONS; \
delete from ZSD_ZEND_EXTENSIONS_DIRECTIVES;"; \
sqlite3 /usr/local/zend/var/db/gui.db "delete from GUI_WEBAPI_KEYS where NAME = 'admin';"; \
sed -i -e "s|^\s*zend.serial_number.*\$|zend.serial_number=|" \
-e "s|^\s*zend.user_name.*\$|zend.user_name=|" \
/usr/local/zend/etc/ZendGlobalDirectives.ini; \
echo > /usr/local/zend/var/log/zsd.log; \
mv /root/files/* /usr/local/bin/; \
wget -O /usr/local/bin/zs-client.phar "https://github.com/zend-patterns/ZendServerSDK/raw/master/bin/zs-client.phar"; \
chmod +x /usr/local/bin/*; \
ln -s /var/www/html /dr; \
ln -s /usr/local/zend/bin/php /usr/local/bin/php; \
mkdir /var/zs-xchange
COPY extensions/swoole-ZS_2019.0.5-php_7.3-ubuntu_bionic.run.tgz extensions/inotify-ZS_2019.0.5-php_7.3-ubuntu_bionic.run.tgz /usr/local/zend/tmp/
RUN cd /usr/local/zend/tmp; \
tar xf swoole-ZS_2019.0.5-php_7.3-ubuntu_bionic.run.tgz; \
tar xf inotify-ZS_2019.0.5-php_7.3-ubuntu_bionic.run.tgz; \
./swoole-ZS_2019.0.5-php_7.3-ubuntu_bionic.run; \
./inotify-ZS_2019.0.5-php_7.3-ubuntu_bionic.run; \
rm -rf swoole-ZS_2019.0.5-php_7.3-ubuntu_bionic* inotify-ZS_2019.0.5-php_7.3-ubuntu_bionic*; \
sleep 1
ENTRYPOINT ["/usr/local/bin/run.sh"]