-
Notifications
You must be signed in to change notification settings - Fork 192
/
Dockerfile
193 lines (165 loc) · 5.16 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
# This file is automatically generated. Do not edit directly. #
FROM golang:1.15 AS builder
RUN if [ $(uname -m) = "x86_64" ]; then mailhog_arch="amd64"; else mailhog_arch="arm64"; fi \
&& wget -O mhsendmail.tar.gz https://github.com/mailhog/mhsendmail/archive/refs/tags/v0.2.0.tar.gz \
&& tar -xf mhsendmail.tar.gz \
&& mkdir -p ./src/github.com/mailhog/ \
&& mv ./mhsendmail-0.2.0 ./src/github.com/mailhog/mhsendmail \
&& cd ./src/github.com/mailhog/mhsendmail/ \
&& go get . \
&& GOOS=linux GOARCH=${mailhog_arch} go build -o mhsendmail .
FROM php:8.3-cli
ARG COMPOSER_VERSION=2.7.0
ARG MAGENTO_ROOT=/app
ARG COMPOSER_ALLOW_SUPERUSER=1
ARG COMPOSER_HOME=/composer
ARG CRONTAB=""
ENV COMPOSER_MEMORY_LIMIT -1
ENV COMPOSER_ALLOW_SUPERUSER ${COMPOSER_ALLOW_SUPERUSER}
ENV COMPOSER_HOME ${COMPOSER_HOME}
ENV COMPOSER_CLEAR_CACHE false
ENV PHP_MEMORY_LIMIT -1
ENV PHP_VALIDATE_TIMESTAMPS 1
ENV DEBUG false
ENV MAGENTO_RUN_MODE production
ENV SENDMAIL_PATH /dev/null
ENV PHPRC ${MAGENTO_ROOT}/php.ini
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sodium sysvmsg sysvsem sysvshm xsl zip pcntl
# Configure Node.js version
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash
# Install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
apt-utils \
cron \
git \
mariadb-client \
nano \
nodejs \
python3 \
python3-pip \
redis-tools \
sendmail-bin \
sendmail \
sudo \
unzip \
vim \
openssh-client \
gnupg2 \
ca-certificates \
lsb-release \
software-properties-common \
libbz2-dev \
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
libgmp-dev \
libgpgme11-dev \
libicu-dev \
libldap2-dev \
libpcre3-dev \
libpspell-dev \
libtidy-dev \
libxslt1-dev \
libyaml-dev \
libzip-dev \
zip \
python3-yaml \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
# Install Grunt
RUN npm install -g grunt-cli
# Install MailHog
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/local/bin/
RUN sudo chmod +x /usr/local/bin/mhsendmail
# Configure the gd library
RUN docker-php-ext-configure \
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-configure \
opcache --enable-opcache
# Install required PHP extensions
RUN docker-php-ext-install -j$(nproc) \
bcmath \
bz2 \
calendar \
exif \
gd \
gettext \
gmp \
intl \
mysqli \
opcache \
pdo_mysql \
pspell \
shmop \
soap \
sockets \
sysvmsg \
sysvsem \
sysvshm \
tidy \
xsl \
zip \
pcntl
RUN pecl install -o -f \
gnupg \
mailparse \
msgpack \
oauth \
pcov \
raphf \
redis \
xdebug-3.3.0 \
xmlrpc-1.0.0RC3 \
yaml
RUN curl -L https://packages.blackfire.io/gpg.key | gpg --dearmor > blackfire.io-archive-keyring.gpg \
&& install -o root -g root -m 644 blackfire.io-archive-keyring.gpg /etc/apt/trusted.gpg.d/ \
&& echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
&& apt-get update \
&& apt-get install blackfire-php \
&& rm -rf /var/lib/apt/lists/*
RUN if [ $(uname -m) = "x86_64" ]; then ldap_arch="x86_64-linux-gnu"; else ldap_arch="aarch64-linux-gnu"; fi \
&& docker-php-ext-configure ldap --with-libdir=lib/${ldap_arch}
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
&& apt-get remove libsodium* -y \
&& mkdir -p /tmp/libsodium \
&& curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \
&& cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \
&& ./configure \
&& make && make check \
&& make install \
&& cd / \
&& rm -rf /tmp/libsodium \
&& pecl install -o -f libsodium
ADD etc/php-cli.ini /usr/local/etc/php/conf.d/zz-magento.ini
ADD etc/php-xdebug.ini /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
ADD etc/php-pcov.ini /usr/local/etc/php/conf.d/zz-pcov-settings.ini
ADD etc/mail.ini /usr/local/etc/php/conf.d/zz-mail.ini
ADD etc/php-gnupg.ini /usr/local/etc/php/conf.d/gnupg.ini
# Get composer installed to /usr/local/bin/composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --version=${COMPOSER_VERSION} --filename=composer
ADD bin/* /usr/local/bin/
RUN groupadd -g 1000 www && useradd -g 1000 -u 1000 -d ${MAGENTO_ROOT} -s /bin/bash www
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN ["chmod", "+x", \
"/docker-entrypoint.sh", \
"/usr/local/bin/magento-installer", \
"/usr/local/bin/magento-command", \
"/usr/local/bin/mftf-command", \
"/usr/local/bin/ece-command", \
"/usr/local/bin/cloud-build", \
"/usr/local/bin/cloud-deploy", \
"/usr/local/bin/cloud-post-deploy", \
"/usr/local/bin/run-cron", \
"/usr/local/bin/run-hooks" \
]
RUN mkdir -p ${MAGENTO_ROOT}
VOLUME ${MAGENTO_ROOT}
RUN chown -R www:www /usr/local /var/www /var/log /usr/local/etc/php/conf.d /etc/cron.d ${MAGENTO_ROOT} ${COMPOSER_HOME}
RUN if [ ! -z "${CRONTAB}" ]; then echo "${CRONTAB}" > /etc/cron.d/magento && touch /var/log/cron.log ; fi
ENTRYPOINT ["/docker-entrypoint.sh"]
WORKDIR ${MAGENTO_ROOT}
USER root
CMD ["bash"]