-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile.debian
194 lines (189 loc) · 7.27 KB
/
Dockerfile.debian
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
ARG DISTRO=debian
ARG DISTRO_VARIANT=bookworm
FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}
LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)"
ARG PHP_BASE
ENV PHP_BASE=${PHP_BASE:-"8.4"} \
PHP_ENABLE_APCU=TRUE \
PHP_ENABLE_BCMATH=TRUE \
PHP_ENABLE_BZ2=TRUE \
PHP_ENABLE_CTYPE=TRUE \
PHP_ENABLE_CURL=TRUE \
PHP_ENABLE_DOM=TRUE \
PHP_ENABLE_EXIF=TRUE \
PHP_ENABLE_FILEINFO=TRUE \
PHP_ENABLE_GD=TRUE \
PHP_ENABLE_ICONV=TRUE \
PHP_ENABLE_IMAP=TRUE \
PHP_ENABLE_INTL=TRUE \
PHP_ENABLE_MBSTRING=TRUE \
PHP_ENABLE_MYSQLI=TRUE \
PHP_ENABLE_MYSQLND=TRUE \
PHP_ENABLE_OPCACHE=TRUE \
PHP_ENABLE_OPENSSL=TRUE \
PHP_ENABLE_PDO=TRUE \
PHP_ENABLE_PDO_MYSQL=TRUE \
PHP_ENABLE_PGSQL=TRUE \
PHP_ENABLE_PHAR=TRUE \
PHP_ENABLE_SIMPLEXML=TRUE \
PHP_ENABLE_TOKENIZER=TRUE \
PHP_ENABLE_XML=TRUE \
PHP_ENABLE_XMLREADER=TRUE \
PHP_ENABLE_XMLWRITER=TRUE \
CONTAINER_ENABLE_MESSAGING=TRUE \
NGINX_ENABLE_CREATE_SAMPLE_HTML=FALSE \
IMAGE_NAME="tiredofit/nginx-php-fpm" \
IMAGE_REPO_URL="https://github.com/tiredofit/docker-nginx-php-fpm/"
### Dependency Installation
RUN export PHP_7_3_RUN_DEPS=" \
php$PHP_BASE-apcu-bc \
php$PHP_BASE-http \
php$PHP_BASE-json \
php$PHP_BASE-mcrypt \
php$PHP_BASE-propro \
php$PHP_BASE-radius \
php$PHP_BASE-recode \
" && \
\
export PHP_7_4_RUN_DEPS=" \
php$PHP_BASE-apcu-bc \
php$PHP_BASE-http \
php$PHP_BASE-json \
php$PHP_BASE-mcrypt \
php$PHP_BASE-propro \
php$PHP_BASE-radius \
" && \
\
export PHP_8_0_RUN_DEPS=" \
php$PHP_BASE-http \
php$PHP_BASE-mcrypt \
" && \
\
export PHP_8_1_RUN_DEPS=" \
php$PHP_BASE-mcrypt \
" && \
\
export PHP_8_2_RUN_DEPS=" \
" && \
\
export PHP_8_3_RUN_DEPS=" \
" && \
\
export PHP_8_4_RUN_DEPS=" \
" && \
\
export PHP_ADDITIONAL_MODULES=" \
php$PHP_BASE-ast \
php$PHP_BASE-apcu \
php$PHP_BASE-gearman \
php$PHP_BASE-grpc \
php$PHP_BASE-imagick \
php$PHP_BASE-inotify \
php$PHP_BASE-mailparse \
php$PHP_BASE-maxminddb \
php$PHP_BASE-memcache \
php$PHP_BASE-memcached \
php$PHP_BASE-mongodb \
php$PHP_BASE-msgpack \
php$PHP_BASE-oauth \
php$PHP_BASE-pcov \
php-pear \
php$PHP_BASE-protobuf \
php$PHP_BASE-smbclient \
#php-sodium \
php$PHP_BASE-uuid \
php$PHP_BASE-xmlrpc \
php$PHP_BASE-zstd \
" && \
\
export PHP_RUN_DEPS=" \
php$PHP_BASE \
php$PHP_BASE-apcu \
php$PHP_BASE-bcmath \
php$PHP_BASE-bz2 \
php$PHP_BASE-cli \
php$PHP_BASE-common \
php$PHP_BASE-curl \
php$PHP_BASE-dba \
php$PHP_BASE-dev \
# php$PHP_BASE-embed \
php$PHP_BASE-enchant \
php$PHP_BASE-fpm \
php$PHP_BASE-gd \
php$PHP_BASE-gmp \
php$PHP_BASE-igbinary \
php$PHP_BASE-imap \
php$PHP_BASE-interbase \
php$PHP_BASE-intl \
php$PHP_BASE-ldap \
php$PHP_BASE-memcached \
php$PHP_BASE-mbstring \
php$PHP_BASE-msgpack \
php$PHP_BASE-mysql \
php$PHP_BASE-odbc \
php$PHP_BASE-opcache \
php$PHP_BASE-pgsql \
php$PHP_BASE-pspell \
php$PHP_BASE-readline \
php$PHP_BASE-redis \
php$PHP_BASE-snmp \
php$PHP_BASE-soap \
php$PHP_BASE-sqlite3 \
php$PHP_BASE-tidy \
php$PHP_BASE-xdebug \
php$PHP_BASE-xml \
php$PHP_BASE-xmlrpc \
php$PHP_BASE-xsl \
php$PHP_BASE-zip \
" && \
source /assets/functions/00-container && \
set -x && \
curl -sSLk https://mariadb.org/mariadb_release_signing_key.asc | apt-key add - && \
mariadb_client_ver="$(curl -sSLk https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | grep "mariadb_server_version=mariadb-" | head -n 1 | cut -d = -f 2 | cut -d - -f 2)" && \
echo "deb https://mirror.its.dal.ca/mariadb/repo/${mariadb_client_ver}/debian $(cat /etc/os-release |grep "VERSION=" | awk 'NR>1{print $1}' RS='(' FS=')') main" > /etc/apt/sources.list.d/mariadb.list && \
curl -sSLk https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb https://apt.postgresql.org/pub/repos/apt $(cat /etc/os-release |grep "VERSION=" | awk 'NR>1{print $1}' RS='(' FS=')')-pgdg main" > /etc/apt/sources.list.d/postgres.list && \
apt-key adv --fetch-keys https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(cat /etc/os-release |grep "VERSION=" | awk 'NR>1{print $1}' RS='(' FS=')') main" > /etc/apt/sources.list.d/php.list && \
package update && \
package upgrade -y && \
package install \
ca-certificates \
git \
mariadb-client \
openssl \
postgresql-client \
${PHP_RUN_DEPS} \
$(printenv PHP$(echo ${PHP_BASE} | sed 's|\.|_|g')_RUN_DEPS) \
${PHP_ADDITIONAL_MODULES} \
&& \
\
### Install PHP Composer
curl -sSLk https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
\
### PHP Setup
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/${PHP_BASE}/cli/php.ini && \
ln -s /usr/sbin/php-fpm${PHP_BASE} /usr/sbin/php-fpm && \
rm -rf /etc/logrotate.d/php* && \
update-alternatives --set php /usr/bin/php${PHP_BASE} && \
#### Disabling any but core extensions - When using this image as a base for other images, you'll want to turn turn them on before running composer with the inverse of phpdisomd (phpenmod) to keep things clean
set +x && \
for f in /etc/php/${PHP_BASE}/mods-available/*.ini; do phpdismod $(basename $f .ini); done; \
php_env_plugins_enabled="$(set | sort | grep PHP_ENABLE_ | grep -i TRUE | cut -d _ -f 3 | cut -d = -f 1 | tr A-Z a-z)" && \
for module in $php_env_plugins_enabled ; do phpenmod ${module} ; done ; \
if [ "$PHP_BASE" = "7.3" ] || [ "$PHP_BASE" = "7.4" ]; then phpenmod json ; fi ; \
set -x && \
\
### Cleaning up all the other PHP version configs
cd /etc/php && \
find . -mindepth 1 -maxdepth 1 -type d -not -name ${PHP_BASE} -exec rm -rf '{}' \; && \
\
package cleanup && \
mkdir -p /var/log/nginx && \
rm -rf \
/root/.gnupg \
/tmp/* \
/usr/src/* \
/var/log/*
EXPOSE 9000
COPY install /