Skip to content

Instantly share code, notes, and snippets.

@HariantoAtWork
Last active May 30, 2021 09:29
Show Gist options
  • Save HariantoAtWork/96900ba413f3d3e430d1444a34451d25 to your computer and use it in GitHub Desktop.
Save HariantoAtWork/96900ba413f3d3e430d1444a34451d25 to your computer and use it in GitHub Desktop.
Dockerfile PHP 8.0.0 FPM with Extensions
FROM php:8.0.0-fpm-alpine
######## Wokring Date 2020-12-19 - By Harianto van Insulinde ########
######## [PHP Modules] Default ########
#### Core
#### ctype
#### curl
#### date
#### dom
#### fileinfo
#### filter
#### ftp
#### hash
#### iconv
#### json
#### libxml
#### mbstring
#### mysqlnd
#### openssl
#### pcre
#### PDO
#### pdo_sqlite
#### Phar
#### posix
#### readline
#### Reflection
#### session
#### SimpleXML
#### sodium
#### SPL
#### sqlite3
#### standard
#### tokenizer
#### xml
#### xmlreader
#### xmlwriter
#### zlib
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN sed -i 's/;pcre.jit=1/pcre.jit=0/g' "$PHP_INI_DIR/php.ini"
######## Composer.phar ########
RUN curl -s https://getcomposer.org/installer | php \
# move composer into a bin directory you control:
&& mv composer.phar /usr/local/bin/composer \
# double check composer works
&& composer about
RUN php -m && echo "============================================="
######## Dependencies ########
#### bz2: bzip2-dev
#### enchant: enchant2-dev
#### gd: libpng-dev
#### gmp: gmp-dev
#### imap: imap-dev
#### intl: icu-dev
#### ldap: openldap-dev
#### pdo_dblib: freetds-dev
#### pdo_pgsql: postgresql-dev
#### pgsql: postgresql-dev
#### pspell: aspell-dev
#### snmp: net-snmp-dev
#### soap: libxml2-dev
#### tidy: tidyhtml-dev
#### xsl: libxslt-dev
#### zip: libzip-dev
RUN apk add --no-cache --update \
bzip2-dev \
enchant2-dev \
libpng-dev \
gmp-dev \
imap-dev \
icu-dev \
openldap-dev \
freetds-dev \
postgresql-dev \
aspell-dev \
net-snmp-dev \
libxml2-dev \
tidyhtml-dev \
libxslt-dev \
libzip-dev
RUN docker-php-ext-install \
bcmath \
bz2 \
calendar \
dba \
enchant \
exif \
ffi \
gd \
gettext \
gmp \
imap \
intl \
ldap \
mysqli \
opcache \
pcntl \
pdo_dblib \
pdo_mysql \
pdo_pgsql \
pgsql \
pspell \
shmop \
snmp \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
xsl \
zend_test \
zip
RUN rm -rf /tmp/* /var/cache/apk/* \
&& echo "=============================================" \
&& php -m
######## PHP MODULES not working yet ########
#### oci8
#### odbc
#### pdo_firebird
#### pdo_oci
#### pdo_odbc
######## odbc: Super Script ########
# RUN set -ex; \
# docker-php-source extract; \
# { \
# echo '# https://github.com/docker-library/php/issues/103#issuecomment-271413933'; \
# echo 'AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl'; \
# echo; \
# cat /usr/src/php/ext/odbc/config.m4; \
# } > temp.m4; \
# mv temp.m4 /usr/src/php/ext/odbc/config.m4; \
# apk add --no-cache unixodbc-dev; \
# docker-php-ext-configure odbc --with-unixODBC=shared,/usr; \
# docker-php-ext-install odbc; \
# docker-php-source delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment