Skip to content

Commit 15c1668

Browse files
committed
added docker file for php 8.2
1 parent 113d841 commit 15c1668

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

bin/php82/Dockerfile

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
FROM php:8.2.1-apache-buster
2+
3+
# Surpresses debconf complaints of trying to install apt packages interactively
4+
# https://github.com/moby/moby/issues/4032#issuecomment-192327844
5+
6+
ARG DEBIAN_FRONTEND=noninteractive
7+
8+
# Update
9+
RUN apt-get -y update --fix-missing && \
10+
apt-get upgrade -y && \
11+
apt-get --no-install-recommends install -y apt-utils && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
15+
# Install useful tools and install important libaries
16+
RUN apt-get -y update && \
17+
apt-get -y --no-install-recommends install nano wget \
18+
dialog \
19+
libsqlite3-dev \
20+
libsqlite3-0 && \
21+
apt-get -y --no-install-recommends install default-mysql-client \
22+
zlib1g-dev \
23+
libzip-dev \
24+
libicu-dev && \
25+
apt-get -y --no-install-recommends install --fix-missing apt-utils \
26+
build-essential \
27+
git \
28+
curl \
29+
libonig-dev && \
30+
apt-get install -y iputils-ping && \
31+
apt-get -y --no-install-recommends install --fix-missing libcurl4 \
32+
libcurl4-openssl-dev \
33+
zip \
34+
openssl && \
35+
rm -rf /var/lib/apt/lists/* && \
36+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
37+
38+
# Install xdebug
39+
RUN pecl install xdebug-3.1.4 && \
40+
docker-php-ext-enable xdebug && \
41+
mkdir /var/log/xdebug
42+
43+
# Install redis
44+
RUN pecl install redis-5.3.3 && \
45+
docker-php-ext-enable redis
46+
47+
# Install imagick
48+
RUN apt-get update && \
49+
apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \
50+
rm -rf /var/lib/apt/lists/*
51+
52+
# Workarround until imagick is available in pecl with php8 support
53+
# Imagick Commit to install
54+
# https://github.com/Imagick/imagick
55+
ARG IMAGICK_COMMIT="661405abe21d12003207bc8eb0963fafc2c02ee4"
56+
57+
RUN cd /usr/local/src && \
58+
git clone https://github.com/Imagick/imagick && \
59+
cd imagick && \
60+
git checkout ${IMAGICK_COMMIT} && \
61+
phpize && \
62+
./configure && \
63+
make && \
64+
make install && \
65+
cd .. && \
66+
rm -rf imagick && \
67+
docker-php-ext-enable imagick
68+
69+
# Other PHP8 Extensions
70+
71+
RUN docker-php-ext-install pdo_mysql && \
72+
docker-php-ext-install pdo_sqlite && \
73+
docker-php-ext-install bcmath && \
74+
docker-php-ext-install mysqli && \
75+
docker-php-ext-install curl && \
76+
docker-php-ext-install zip && \
77+
docker-php-ext-install -j$(nproc) intl && \
78+
docker-php-ext-install mbstring && \
79+
docker-php-ext-install gettext && \
80+
docker-php-ext-install calendar && \
81+
docker-php-ext-install exif
82+
83+
84+
# Install Freetype
85+
RUN apt-get -y update && \
86+
apt-get --no-install-recommends install -y libfreetype6-dev \
87+
libjpeg62-turbo-dev \
88+
libpng-dev && \
89+
rm -rf /var/lib/apt/lists/* && \
90+
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \
91+
docker-php-ext-install gd
92+
93+
# Insure an SSL directory exists
94+
RUN mkdir -p /etc/apache2/ssl
95+
96+
# Enable SSL support
97+
RUN a2enmod ssl && a2enmod rewrite
98+
99+
# Enable apache modules
100+
RUN a2enmod rewrite headers
101+
102+
# Cleanup
103+
RUN rm -rf /usr/src/*

0 commit comments

Comments
 (0)