Skip to content

Commit 968707a

Browse files
committed
PHP 8.0 support
1 parent 4ed5f7d commit 968707a

File tree

7 files changed

+947
-0
lines changed

7 files changed

+947
-0
lines changed

8.0/Dockerfile

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
FROM debian:buster
2+
3+
MAINTAINER keopx <keopx@keopx.net>
4+
5+
#
6+
# Step 1: Installation
7+
#
8+
9+
# System environments
10+
ENV DEBIAN_FRONTEND="noninteractive" \
11+
LOCALE="es_ES.UTF-8" \
12+
GOTPL_VER="0.1.5" \
13+
DEFAULT_ROOT="/var/www/html" \
14+
UID="1000" \
15+
GID="1000" \
16+
UNAME="keopx"
17+
18+
# Set repositories
19+
RUN \
20+
echo "deb http://ftp.de.debian.org/debian/ buster main non-free contrib" > /etc/apt/sources.list && \
21+
echo "deb-src http://ftp.de.debian.org/debian/ buster main non-free contrib" >> /etc/apt/sources.list && \
22+
echo "deb http://security.debian.org/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \
23+
echo "deb-src http://security.debian.org/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \
24+
apt-get -qq update && apt-get -qqy upgrade && \
25+
# Install some basic tools needed for deployment
26+
apt-get -yqq install \
27+
apt-utils \
28+
build-essential \
29+
debconf-utils \
30+
debconf \
31+
default-mysql-client \
32+
locales \
33+
curl \
34+
wget \
35+
unzip \
36+
patch \
37+
rsync \
38+
vim \
39+
nano \
40+
openssh-client \
41+
git \
42+
bash-completion \
43+
locales \
44+
libjpeg-turbo-progs libjpeg-progs \
45+
pngcrush optipng && \
46+
# Install locale
47+
sed -i -e "s/# $LOCALE/$LOCALE/" /etc/locale.gen && \
48+
echo "LANG=$LOCALE">/etc/default/locale && \
49+
dpkg-reconfigure --frontend=noninteractive locales && \
50+
update-locale LANG=$LOCALE && \
51+
# GOTPL
52+
gotpl_url="https://github.com/wodby/gotpl/releases/download/${GOTPL_VER}/gotpl-linux-amd64-${GOTPL_VER}.tar.gz"; \
53+
wget -qO- "${gotpl_url}" | tar xz -C /usr/local/bin; \
54+
# Configure Sury sources
55+
# @see https://www.noobunbox.net/serveur/auto-hebergement/installer-php-7-1-sous-debian-et-ubuntu
56+
apt-get -yqq install apt-transport-https lsb-release ca-certificates && \
57+
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
58+
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
59+
# Install PHP7 with Xdebug (dev environment)
60+
apt-get -qq update && \
61+
apt-get -yqq install \
62+
php8.0 \
63+
php8.0-bcmath \
64+
php8.0-bz2 \
65+
php8.0-curl \
66+
php8.0-dev \
67+
php8.0-gd \
68+
php8.0-dom \
69+
php8.0-imap \
70+
php8.0-intl \
71+
php8.0-ldap \
72+
php8.0-mbstring \
73+
php8.0-mysql \
74+
php8.0-oauth \
75+
php8.0-odbc \
76+
php8.0-xml \
77+
php8.0-yaml \
78+
php8.0-zip \
79+
php8.0-solr \
80+
php8.0-apcu \
81+
php8.0-opcache \
82+
php8.0-redis \
83+
php8.0-memcache \
84+
php8.0-xdebug \
85+
libapache2-mod-php8.0 && \
86+
# Install manually xhprof
87+
# cd /tmp && \
88+
# wget https://github.com/Yaoguais/phpng-xhprof/archive/master.zip && \
89+
# unzip master.zip && \
90+
# cd phpng-xhprof-master && \
91+
# phpize8.0 && \
92+
# ./configure --with-php-config=/usr/bin/php-config8.0 && \
93+
# make && make install && \
94+
# mv /usr/lib/php/20190902/phpng_xhprof.so /usr/lib/php/20190902/xhprof.so && \
95+
# echo "extension=xhprof.so" > /etc/php/8.0/mods-available/xhprof.ini && \
96+
# echo "xhprof.output_dir=/var/www/xhprof" >> /etc/php/8.0/mods-available/xhprof.ini && \
97+
98+
# Install manually APC
99+
# echo "extension=apcu.so" > /etc/php/7.2/mods-available/apcu_bc.ini && \
100+
# echo "extension=apc.so" >> /etc/php/7.2/mods-available/apcu_bc.ini && \
101+
# Install SMTP.
102+
apt-get -yqq install libgnutls-openssl27 && \
103+
wget ftp.de.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64-8+b2_amd64.deb && \
104+
dpkg -i ssmtp_2.64-8+b2_amd64.deb && rm ssmtp_2.64-8+b2_amd64.deb && \
105+
# Install Apache web server.
106+
apt-get -yqq install apache2 && \
107+
#
108+
# Step 2: Configuration
109+
#
110+
# Enable uploadprogress, imagick, redis and solr.
111+
phpenmod uploadprogress imagick redis solr && \
112+
# Disable by default apcu, apcu_bc, opcache, xdebug and xhprof. Use docker-compose.yml to add file.
113+
phpdismod apcu apcu_bc opcache xdebug xhprof && \
114+
# Remove all sites enabled
115+
# RUN rm /etc/apache2/sites-enabled/*
116+
# Configure needed apache modules and disable default site
117+
# mpm_worker enabled.
118+
a2dismod mpm_event cgi && \
119+
a2enmod \
120+
access_compat \
121+
actions \
122+
alias \
123+
auth_basic \
124+
authn_core \
125+
authn_file \
126+
authz_core \
127+
authz_groupfile \
128+
authz_host \
129+
authz_user \
130+
autoindex \
131+
dir \
132+
env \
133+
expires \
134+
filter \
135+
headers \
136+
mime \
137+
negotiation \
138+
php8.0 \
139+
mpm_prefork \
140+
reqtimeout \
141+
rewrite \
142+
setenvif \
143+
status \
144+
ssl && \
145+
# without the following line we get "AH00558: apache2: Could not reliably determine the server's fully qualified domain name"
146+
# autorise .htaccess files
147+
sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf && \
148+
# Install composer (latest version) | prestissimo to speed up composer
149+
php -r "copy('https://getcomposer.org/composer-1.phar', 'composer.phar');" && \
150+
php composer.phar && \
151+
mv composer.phar /usr/local/bin/composer && \
152+
chmod 755 /usr/local/bin/composer && \
153+
composer global require "hirak/prestissimo:^0.3" && \
154+
### Install DRUSH (latest stable) ###
155+
# Run this in your terminal to get the latest DRUSH project version:
156+
composer global require drush/drush && \
157+
~/.composer/vendor/bin/drush init -y && \
158+
curl -OL https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar && \
159+
mv drush.phar /usr/local/bin/drush && \
160+
chmod +x /usr/local/bin/drush && \
161+
### Install DRUPAL CONSOLE (latest version) ###
162+
# Run this in your terminal to get the latest project version:
163+
# curl https://drupalconsole.com/installer -L -o drupal.phar && \
164+
# mv drupal.phar /usr/local/bin/drupal && \
165+
# chmod +x /usr/local/bin/drupal && \
166+
# drupal self-update && \
167+
# Bash setup.
168+
echo ". /usr/share/bash-completion/bash_completion" >> ~/.bashrc && echo "alias ll='ls -lahs'" >> ~/.bashrc && \
169+
#
170+
# Step 3: Clean the system
171+
#
172+
# Cleanup some things.
173+
apt-get -q autoclean && \
174+
rm -rf /var/lib/apt/lists/* && \
175+
#
176+
# Step 4: Run
177+
#
178+
# Create 'keopx' user like local machime user.
179+
groupadd -g $UID $GID ; \
180+
useradd -m -u $UID -g $GID -s /bin/bash $UNAME ; \
181+
usermod -aG www-data $UNAME; \
182+
echo ". /usr/share/bash-completion/bash_completion" >> ~/.bashrc && echo "alias ll='ls -lahs'" >> /home/$UNAME/.bashrc
183+
# Working dir
184+
WORKDIR ${DEFAULT_ROOT}
185+
# Configure templates
186+
COPY templates /etc/gotpl/
187+
COPY scripts/apache2-foreground /usr/bin/
188+
EXPOSE 80 443
189+
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)