-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
95 lines (91 loc) · 2.55 KB
/
Dockerfile
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
FROM php:8.1-alpine
MAINTAINER Chris Morrell
ENV DOCKERIZE_VERSION=v0.6.1 \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
RUN mkdir -p ~/Downloads /app \
&& apk upgrade \
# Base install (installs all the dependencies we want in our final image)
&& apk add --no-cache \
bash \
git \
openssl \
libpng \
libgomp\
freetype \
ttf-freefont \
libjpeg-turbo \
mysql-client \
libstdc++ \
chromium \
chromium-chromedriver \
nss \
harfbuzz \
nodejs \
yarn \
npm \
imagemagick \
curl \
tar \
icu-dev \
zlib-dev \
libzip-dev \
sqlite \
# Install build dependencies that will be removed from the final image
&& apk add --no-cache --virtual .build-deps \
libpng-dev \
freetype-dev \
libjpeg-turbo-dev \
autoconf \
gcc \
make \
g++ \
zlib-dev \
file \
libc-dev \
pkgconf \
libmemcached-dev \
binutils-gold \
gnupg \
libgcc \
linux-headers \
python3 \
imagemagick-dev \
libtool \
# Use the default development php.ini file
&& mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" \
# Configure PHP extensions
&& docker-php-ext-configure intl \
&& docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install -j$(nproc) intl \
&& docker-php-ext-install -j$(nproc) zip \
&& docker-php-ext-install -j$(nproc) pdo_mysql \
&& docker-php-ext-install -j$(nproc) bcmath \
&& docker-php-ext-configure gd \
--enable-gd \
--with-jpeg \
--with-freetype \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install -j$(nproc) exif \
&& docker-php-ext-install -j$(nproc) pcntl \
&& docker-php-ext-install -j$(nproc) sockets \
&& pecl install xdebug \
&& pecl install imagick \
&& pecl install redis \
&& pecl install pcov \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable redis \
&& docker-php-ext-enable pcov \
# Install composer
&& php -r "copy('https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /usr/local/bin/composer \
# Install dockerize
&& wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
# Clean up packages only needed a build time
&& apk del .build-deps && rm -rf tmp/*
# And we're set
CMD ["/bin/bash"]