forked from pimcore/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
208 lines (174 loc) · 4.12 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# syntax=docker/dockerfile:1
ARG PHP_VERSION="8.2"
ARG DEBIAN_VERSION="bookworm"
FROM php:${PHP_VERSION}-fpm-${DEBIAN_VERSION} AS pimcore_php_min
COPY --chmod=0755 files/build-*.sh /usr/local/bin/
RUN set -eux; \
\
DPKG_ARCH="$(dpkg --print-architecture)"; \
echo "deb http://deb.debian.org/debian bookworm-backports main" > /etc/apt/sources.list.d/backports.list; \
apt-get update; \
apt-get upgrade -y; \
\
# tools used by Pimcore
apt-get install -y \
iproute2 \
unzip \
; \
\
# dependencies for building PHP extensions
apt-get install -y \
libicu-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
zlib1g-dev \
; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg; \
docker-php-ext-configure pcntl --enable-pcntl; \
docker-php-ext-install \
bcmath \
exif \
gd \
intl \
opcache \
pcntl \
pdo_mysql \
sockets \
zip \
; \
\
build-cleanup.sh; \
\
{ \
echo "upload_max_filesize = 100M"; \
echo "memory_limit = 256M"; \
echo "post_max_size = 100M"; \
} > /usr/local/etc/php/conf.d/20-pimcore.ini; \
\
ldconfig /usr/local/lib; \
\
sync
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_MEMORY_LIMIT -1
COPY --from=composer/composer:2-bin /composer /usr/local/bin/composer
WORKDIR /var/www/html
CMD ["php-fpm"]
FROM pimcore_php_min AS pimcore_php_default
RUN set -eux; \
\
build-install.sh; \
\
DPKG_ARCH="$(dpkg --print-architecture)"; \
echo "deb https://www.deb-multimedia.org bookworm main non-free" > /etc/apt/sources.list.d/deb-multimedia.list; \
apt-get update -oAcquire::AllowInsecureRepositories=true; \
apt-get install -y --allow-unauthenticated deb-multimedia-keyring; \
apt-get update; \
\
# tools used by Pimcore
apt-get install -y \
exiftool \
ffmpeg \
ghostscript \
git \
graphviz \
jpegoptim \
locales \
locales-all \
optipng \
pngquant \
poppler-utils \
webp \
; \
\
# dependencies for building PHP extensions
apt-get install -y \
libfreetype6-dev \
libwebp-dev \
; \
\
# ImageMagick
apt-get install -y \
imagemagick-7 \
libmagickwand-7-dev \
; \
\
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp; \
docker-php-ext-install gd; \
\
pecl install -f \
apcu \
imagick \
redis \
; \
docker-php-ext-enable \
apcu \
imagick \
redis \
; \
\
build-cleanup.sh; \
\
ldconfig /usr/local/lib; \
\
sync
CMD ["php-fpm"]
FROM pimcore_php_default AS pimcore_php_max
RUN set -eux; \
\
build-install.sh; \
\
apt-get install -y \
chromium-sandbox \
libc-client-dev \
libkrb5-dev \
libreoffice \
libxml2-dev \
openssl \
; \
\
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install \
imap \
soap \
; \
docker-php-ext-enable \
imap \
soap \
; \
\
build-cleanup.sh; \
\
sync
CMD ["php-fpm"]
FROM pimcore_php_default AS pimcore_php_debug
RUN set -eux; \
\
build-install.sh; \
\
pecl install xdebug; \
docker-php-ext-enable xdebug; \
\
build-cleanup.sh; \
\
# Allow running as an arbitrary user, as the config will be changed through
# the entrypoint.sh script
chmod -R 0777 /usr/local/etc/php/conf.d/
ENV PHP_IDE_CONFIG serverName=localhost
COPY --chmod=0755 files/entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["php-fpm"]
FROM pimcore_php_default AS pimcore_php_supervisord
RUN set -eux; \
\
apt-get update; \
apt-get install -y \
cron \
supervisor \
; \
\
chmod gu+rw /var/run; \
chmod gu+s /usr/sbin/cron
COPY files/supervisord.conf /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord"]